summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-03-28 13:57:11 +0000
committerNeil Roberts <neil@linux.intel.com>2013-04-04 13:37:51 +0100
commita1952a25ad44d0228169b66c0cafbfba48f0b8c6 (patch)
treedfb88135e35284fe13de73c38bdb619259ecbd2f
parentdabfbcce536d749fd1066a9315183bdc3ba55c89 (diff)
downloadcogl-a1952a25ad44d0228169b66c0cafbfba48f0b8c6.tar.gz
quartz-image: Pass a CoglError argument to the bitmap functions
Since 67cad9c0 and f7735e141a the bitmap allocation and mapping functions now take an extra error argument. The quartz image backend was missed in this update so Cogl would fail to compile if --enable-quartz-image is used. https://bugzilla.gnome.org/show_bug.cgi?id=696730 Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 1827965befccf331b0787f71cb191d370640a9de)
-rw-r--r--cogl/cogl-bitmap-pixbuf.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cogl/cogl-bitmap-pixbuf.c b/cogl/cogl-bitmap-pixbuf.c
index a02b253c..ad34234a 100644
--- a/cogl/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl-bitmap-pixbuf.c
@@ -125,11 +125,24 @@ _cogl_bitmap_from_file (CoglContext *ctx,
/* allocate buffer big enough to hold pixel data */
bmp = _cogl_bitmap_new_with_malloc_buffer (ctx,
width, height,
- COGL_PIXEL_FORMAT_ARGB_8888);
+ COGL_PIXEL_FORMAT_ARGB_8888,
+ error);
+ if (bmp == NULL)
+ {
+ CFRelease (image);
+ return NULL;
+ }
rowstride = cogl_bitmap_get_rowstride (bmp);
out_data = _cogl_bitmap_map (bmp,
COGL_BUFFER_ACCESS_WRITE,
- COGL_BUFFER_MAP_HINT_DISCARD);
+ COGL_BUFFER_MAP_HINT_DISCARD,
+ error);
+ if (out_data == NULL)
+ {
+ cogl_object_unref (bmp);
+ CFRelease (image);
+ return NULL;
+ }
/* render to buffer */
color_space = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);