diff options
author | Adel Gadllah <adel.gadllah@gmail.com> | 2013-06-25 15:04:19 +0200 |
---|---|---|
committer | Adel Gadllah <adel.gadllah@gmail.com> | 2013-06-25 20:29:20 +0200 |
commit | 180e7d74f3325731ac5e91350233c26200a44fd7 (patch) | |
tree | 0a81ebc6dacc5498d9cfe38b63e949c1917b21f5 /clutter/clutter-offscreen-effect.c | |
parent | 8ac93460467e27f92e6fcc1e30f5d4f387449a37 (diff) | |
download | clutter-180e7d74f3325731ac5e91350233c26200a44fd7.tar.gz |
clutter-offscreen-effect: Allocate the cogl texture directly
Cogl now lazy loads the textures so we cannot rely on getting NULL
from cogl_texture_new_with_size so we have to allocate it by ourselves.
https://bugzilla.redhat.com/show_bug.cgi?id=975171
Diffstat (limited to 'clutter/clutter-offscreen-effect.c')
-rw-r--r-- | clutter/clutter-offscreen-effect.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index 5394fb820..e1197b56f 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -139,9 +139,21 @@ clutter_offscreen_effect_real_create_texture (ClutterOffscreenEffect *effect, gfloat width, gfloat height) { - return cogl_texture_new_with_size (MAX (width, 1), MAX (height, 1), - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_RGBA_8888_PRE); + CoglError *error = NULL; + CoglHandle texture = cogl_texture_new_with_size (MAX (width, 1), MAX (height, 1), + COGL_TEXTURE_NO_SLICING, + COGL_PIXEL_FORMAT_RGBA_8888_PRE); + + if (!cogl_texture_allocate (texture, &error)) + { +#if CLUTTER_ENABLE_DEBUG + g_warning ("Unable to allocate texture for offscreen effect: %s", error->message); +#endif /* CLUTTER_ENABLE_DEBUG */ + cogl_error_free (error); + return NULL; + } + + return texture; } static gboolean |