[maemo-commits] [maemo-commits] r19137 - in projects/haf/trunk/clutter0.8: clutter debian

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Aug 18 15:30:29 EEST 2009
Author: gw
Date: 2009-08-18 15:30:12 +0300 (Tue, 18 Aug 2009)
New Revision: 19137

Modified:
   projects/haf/trunk/clutter0.8/clutter/clutter-actor.c
   projects/haf/trunk/clutter0.8/debian/changelog
Log:
  * clutter/clutter-actor.c: Made allow_redraw act on children as well (so we
    can cut down redraws from hildon-desktop). Stop set_opacity and set_clip
    causing redraw if nothing has changed.


Modified: projects/haf/trunk/clutter0.8/clutter/clutter-actor.c
===================================================================
--- projects/haf/trunk/clutter0.8/clutter/clutter-actor.c	2009-08-18 11:14:31 UTC (rev 19136)
+++ projects/haf/trunk/clutter0.8/clutter/clutter-actor.c	2009-08-18 12:30:12 UTC (rev 19137)
@@ -396,6 +396,9 @@
                                                   ClutterRequestMode mode);
 static gboolean clutter_actor_is_on_stage(ClutterActor *self);
 
+static ClutterActor *
+            clutter_actor_get_stage_if_allow_redraw (ClutterActor *actor);
+
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterActor,
                                   clutter_actor,
                                   G_TYPE_INITIALLY_UNOWNED,
@@ -3047,13 +3050,12 @@
 
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
-  if (!self->priv->allow_redraw ||
-      (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
+  if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION)
     return;
 
   clutter_actor_notify_modified( self );
 
-  if ((stage = clutter_actor_get_stage (self)) != NULL)
+  if ((stage = clutter_actor_get_stage_if_allow_redraw (self)) != NULL)
     clutter_stage_queue_redraw (CLUTTER_STAGE (stage));
 }
 
@@ -4989,10 +4991,13 @@
 {
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
-  self->priv->opacity = opacity;
+  if (self->priv->opacity != opacity)
+    {
+      self->priv->opacity = opacity;
 
-  if (CLUTTER_ACTOR_IS_VISIBLE (self))
-    clutter_actor_queue_redraw (self);
+      if (CLUTTER_ACTOR_IS_VISIBLE (self))
+        clutter_actor_queue_redraw (self);
+    }
 }
 
 /**
@@ -5489,6 +5494,14 @@
 
   priv = self->priv;
 
+  /* If there has been no change... */
+  if (priv->has_clip &&
+      priv->clip[0] == xoff &&
+      priv->clip[1] == yoff &&
+      priv->clip[2] == width &&
+      priv->clip[3] == height)
+    return;
+
   priv->clip[0] = xoff;
   priv->clip[1] = yoff;
   priv->clip[2] = width;
@@ -7493,6 +7506,24 @@
   return actor;
 }
 
+/* Only return the stage if allow_redraw is set for all parents.
+ * Used in clutter_actor_queue_redraw to stop us redrawing if
+ * any parent doesn't have allow_redraw set... */
+static ClutterActor *
+clutter_actor_get_stage_if_allow_redraw (ClutterActor *actor)
+{
+  g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
+
+  while (actor && !(CLUTTER_PRIVATE_FLAGS (actor) & CLUTTER_ACTOR_IS_TOPLEVEL))
+    {
+      if (!CLUTTER_ACTOR_GET_PRIVATE(actor)->allow_redraw)
+        return NULL;
+      actor = clutter_actor_get_parent (actor);
+    }
+
+  return actor;
+}
+
 /**
  * clutter_actor_allocate_preferred_size:
  * @self: a #ClutterActor
@@ -7674,8 +7705,8 @@
  * @self: a #ClutterActor
  *
  * Sets whether to allow clutter_actor_queue_redraw to actually work
- * when called on this actor. Used for optimisation of when to allow
- * redrawing.
+ * when called on this actor OR ANY OF ITS CHILDREN. Used for optimisation
+ * of when to allow redrawing.
  *
  * Since: 0.8.2-maemo
  */

Modified: projects/haf/trunk/clutter0.8/debian/changelog
===================================================================
--- projects/haf/trunk/clutter0.8/debian/changelog	2009-08-18 11:14:31 UTC (rev 19136)
+++ projects/haf/trunk/clutter0.8/debian/changelog	2009-08-18 12:30:12 UTC (rev 19137)
@@ -1,6 +1,8 @@
 clutter (0.8.2-0maemo45~unreleased) unstable; urgency=low
 
-  * foo
+  * clutter/clutter-actor.c: Made allow_redraw act on children as well (so we
+    can cut down redraws from hildon-desktop). Stop set_opacity and set_clip
+    causing redraw if nothing has changed.
 
  -- Gordon Williams <gordon.williams at collabora.co.uk>  Wed, 12 Aug 2009 16:25:48 +0300
 

More information about the maemo-commits mailing list