[clutter-gtk] actor: Update after the API change in Clutter



commit 7990db472a03fbefb8673d018f297cf5a89ef769
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Jul 3 14:39:33 2013 +0100

    actor: Update after the API change in Clutter
    
    The unstable ClutterCanvas API was changed, so we need to update
    GtkClutterActor to use it.

 clutter-gtk/gtk-clutter-actor.c |   27 ++++++---------------------
 1 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-actor.c b/clutter-gtk/gtk-clutter-actor.c
index d1e7c64..b5de571 100644
--- a/clutter-gtk/gtk-clutter-actor.c
+++ b/clutter-gtk/gtk-clutter-actor.c
@@ -195,35 +195,20 @@ gtk_clutter_actor_realize (ClutterActor *actor)
     {
       int width = gtk_widget_get_allocated_width (priv->widget);
       int height = gtk_widget_get_allocated_height (priv->widget);
-      int canvas_width = 0, canvas_height = 0;
 
       DEBUG (G_STRLOC ": Using image surface.\n");
 
-      g_object_get (priv->canvas,
-                    "width", &canvas_width,
-                    "height", &canvas_height,
-                    NULL);
-
-
       clutter_actor_set_size (priv->texture, width, height);
 
       /* clutter_canvas_set_size() will invalidate its contents only
        * if the size differs, but we want to invalidate the contents
-       * in any case; we cannot call clutter_content_invalidate(),
-       * though, because that may cause two invalidations in a row,
-       * so we check the size of the canvas first.
+       * in any case; we cannot call clutter_content_invalidate()
+       * unconditionally, though, because that may cause two
+       * invalidations in a row, so we check the size of the canvas
+       * first.
        */
-      if (width != canvas_width ||
-          height != canvas_height)
-        {
-          clutter_canvas_set_size (CLUTTER_CANVAS (priv->canvas),
-                                   width,
-                                   height);
-        }
-      else
-        {
-          clutter_content_invalidate (priv->canvas);
-        }
+      if (!clutter_canvas_set_size (CLUTTER_CANVAS (priv->canvas), width, height))
+        clutter_content_invalidate (priv->canvas);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]