Blame SOURCES/0001-clutter-offscreen-effect-Allocate-the-cogl-texture-d.patch

3e8236
From b416224d30ea5ace492f1497101a172a6fb32997 Mon Sep 17 00:00:00 2001
3e8236
From: Adel Gadllah <adel.gadllah@gmail.com>
3e8236
Date: Tue, 25 Jun 2013 15:04:19 +0200
3e8236
Subject: [PATCH] clutter-offscreen-effect: Allocate the cogl texture directly
3e8236
3e8236
Cogl now lazy loads the textures so we cannot rely on getting NULL
3e8236
from cogl_texture_new_with_size so we have to allocate it by ourselves.
3e8236
3e8236
https://bugzilla.redhat.com/show_bug.cgi?id=975171
3e8236
---
3e8236
 clutter/clutter-offscreen-effect.c | 18 +++++++++++++++---
3e8236
 1 file changed, 15 insertions(+), 3 deletions(-)
3e8236
3e8236
diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c
3e8236
index b655b5d..d3ffaea 100644
3e8236
--- a/clutter/clutter-offscreen-effect.c
3e8236
+++ b/clutter/clutter-offscreen-effect.c
3e8236
@@ -139,9 +139,21 @@ clutter_offscreen_effect_real_create_texture (ClutterOffscreenEffect *effect,
3e8236
                                               gfloat                  width,
3e8236
                                               gfloat                  height)
3e8236
 {
3e8236
-  return cogl_texture_new_with_size (MAX (width, 1), MAX (height, 1),
3e8236
-                                     COGL_TEXTURE_NO_SLICING,
3e8236
-                                     COGL_PIXEL_FORMAT_RGBA_8888_PRE);
3e8236
+  CoglError *error = NULL;
3e8236
+  CoglHandle texture = cogl_texture_new_with_size (MAX (width, 1), MAX (height, 1),
3e8236
+                                                   COGL_TEXTURE_NO_SLICING,
3e8236
+                                                   COGL_PIXEL_FORMAT_RGBA_8888_PRE);
3e8236
+
3e8236
+  if (!cogl_texture_allocate (texture, &error))
3e8236
+    {
3e8236
+#if CLUTTER_ENABLE_DEBUG
3e8236
+      g_warning ("Unable to allocate texture for offscreen effect: %s", error->message);
3e8236
+#endif /* CLUTTER_ENABLE_DEBUG */
3e8236
+      cogl_error_free (error);
3e8236
+      return NULL;
3e8236
+    }
3e8236
+
3e8236
+  return texture;
3e8236
 }
3e8236
 
3e8236
 static gboolean
3e8236
-- 
3e8236
2.1.0
3e8236