summaryrefslogtreecommitdiff
path: root/cogl/cogl-framebuffer.c
diff options
context:
space:
mode:
authorAdel Gadllah <adel.gadllah@gmail.com>2013-07-03 18:51:53 +0200
committerRobert Bragg <robert@linux.intel.com>2013-08-19 22:44:44 +0100
commit64aa6092ce3413537f5e34807031e25eaaab5a21 (patch)
tree0fd3b81b67c8296e2b2068362a166e1e7ab13021 /cogl/cogl-framebuffer.c
parent28deb1919af9d8355826985da10cf521e3bbd131 (diff)
downloadcogl-64aa6092ce3413537f5e34807031e25eaaab5a21.tar.gz
offscreen: Allocate the framebuffer in cogl_offscreen_new_to_texture_full
The API says that it should return NULL on failure but it does not do that due to the lazy allocation. Reviewed-by: Robert Bragg <robert@linux.intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=703174
Diffstat (limited to 'cogl/cogl-framebuffer.c')
-rw-r--r--cogl/cogl-framebuffer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 25fa937e..fbd3dd6d 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -617,6 +617,7 @@ _cogl_offscreen_new_to_texture_full (CoglTexture *texture,
int level_width;
int level_height;
CoglOffscreen *ret;
+ CoglError *error = NULL;
_COGL_RETURN_VAL_IF_FAIL (cogl_is_texture (texture), NULL);
_COGL_RETURN_VAL_IF_FAIL (level < _cogl_texture_get_n_levels (texture),
@@ -648,6 +649,13 @@ _cogl_offscreen_new_to_texture_full (CoglTexture *texture,
_cogl_texture_associate_framebuffer (texture, fb);
+ if (!cogl_framebuffer_allocate (ret, &error))
+ {
+ cogl_object_unref (offscreen);
+ cogl_error_free (error);
+ ret = NULL;
+ }
+
return ret;
}