2007-07-23 Matthew Allum <mallum@openedhand.com>
authorMatthew Allum <mallum@openedhand.com>
Mon, 23 Jul 2007 17:02:52 +0000 (17:02 +0000)
committerMatthew Allum <mallum@openedhand.com>
Mon, 23 Jul 2007 17:02:52 +0000 (17:02 +0000)
        * clutter/clutter-texture.c: (texture_render_to_gl_quad),
        (clutter_texture_paint):
        Dont be over aggressive in throwing criticals for unrealized
        textures. Doesn't make sense for sub classes. (#403)

ChangeLog
clutter/clutter-texture.c

index 8b56e0b..fb12944 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-23  Matthew Allum  <mallum@openedhand.com>
+
+       * clutter/clutter-texture.c: (texture_render_to_gl_quad),
+       (clutter_texture_paint):
+       Dont be over aggressive in throwing criticals for unrealized
+       textures. Doesn't make sense for sub classes. (#403)
+
 2007-07-22  Emmanuele Bassi  <ebassi@openedhand.com>
 
        Two small fixes for correctly debugging the deinitialisation
index 61b68cb..83734b8 100644 (file)
@@ -303,11 +303,6 @@ texture_render_to_gl_quad (ClutterTexture *texture,
   qwidth  = x2-x1;
   qheight = y2-y1;
 
-  if (!CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR(texture)))
-      clutter_actor_realize (CLUTTER_ACTOR(texture));
-
-  g_return_if_fail(priv->tiles != NULL);
-
   if (!priv->is_tiled)
     {
       cogl_texture_bind (priv->target_type, priv->tiles[0]);
@@ -703,6 +698,23 @@ clutter_texture_paint (ClutterActor *self)
   gint            x1, y1, x2, y2;
   ClutterColor    col = { 0xff, 0xff, 0xff, 0xff };
 
+  if (!CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR(texture)))
+    clutter_actor_realize (CLUTTER_ACTOR(texture));
+
+  if (texture->priv->tiles == NULL)
+    {
+      /* We just need do debug this state, it doesn't really need to 
+       * throw a an error as what previously happened. Sub classes
+       * quite likely may not be able to realize.       
+      */
+      CLUTTER_NOTE (PAINT,
+                   "unable to paint texture '%s', contains no tiles",
+                   clutter_actor_get_name (self) 
+                          ? clutter_actor_get_name (self)
+                          : "unknown");
+      return;
+    }
+
   CLUTTER_NOTE (PAINT,
                 "painting texture '%s'",
                clutter_actor_get_name (self) ? clutter_actor_get_name (self)