mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 21:34:09 +00:00
atlas: catch _create_texture errors
Previously we were passing NULL to cogl_texture_2d_new_{from_bitmap,with_size} so if there was an error the application would be aborted. This ensures we pass an internal CoglError so errors can be caught and suppressed instead. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit b8d1a1db482e1417979df9f88f92da47aa954bd0)
This commit is contained in:
parent
f53fb5e2e0
commit
e439bdd12f
@ -279,6 +279,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
|
|||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
CoglTexture2D *tex;
|
CoglTexture2D *tex;
|
||||||
|
CoglError *ignore_error = NULL;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NULL);
|
_COGL_GET_CONTEXT (ctx, NULL);
|
||||||
|
|
||||||
@ -299,7 +300,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
|
|||||||
|
|
||||||
tex = cogl_texture_2d_new_from_bitmap (clear_bmp,
|
tex = cogl_texture_2d_new_from_bitmap (clear_bmp,
|
||||||
atlas->texture_format,
|
atlas->texture_format,
|
||||||
NULL);
|
&ignore_error);
|
||||||
cogl_object_unref (clear_bmp);
|
cogl_object_unref (clear_bmp);
|
||||||
|
|
||||||
g_free (clear_data);
|
g_free (clear_data);
|
||||||
@ -309,9 +310,12 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
|
|||||||
tex = cogl_texture_2d_new_with_size (ctx,
|
tex = cogl_texture_2d_new_with_size (ctx,
|
||||||
width, height,
|
width, height,
|
||||||
atlas->texture_format,
|
atlas->texture_format,
|
||||||
NULL);
|
&ignore_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!tex)
|
||||||
|
cogl_error_free (ignore_error);
|
||||||
|
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user