mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
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
This commit is contained in:
parent
28deb1919a
commit
64aa6092ce
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user