[clutter] actor: Correct get_paint_volume for an actor with no children and no clip



commit 84632d9c1d54d6902bee42bb9a1aa9f4bf773a90
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 14 15:43:38 2012 -0500

    actor: Correct get_paint_volume for an actor with no children and no clip
    
    We do not need to repaint the entire stage if an actor has no children
    and no clip.

 clutter/clutter-actor.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index fb2269b..2c1b212 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -4687,13 +4687,28 @@ clutter_actor_real_get_paint_volume (ClutterActor       *self,
 {
   ClutterActorPrivate *priv = self->priv;
   ClutterActor *child;
+  ClutterActorClass *klass;
   gboolean res;
 
-  /* this is the default return value: we cannot know if a class
-   * is going to paint outside its allocation, so we take the
-   * conservative approach.
+  klass = CLUTTER_ACTOR_GET_CLASS (self);
+
+  /* XXX - this thoroughly sucks, but we don't want to penalize users
+   * who use ClutterActor as a "new ClutterGroup" by forcing a full-stage
+   * redraw. This should go away in 2.0.
    */
-  res = FALSE;
+  if (klass->paint == clutter_actor_real_paint &&
+      klass->get_paint_volume == clutter_actor_real_get_paint_volume)
+    {
+      res = TRUE;
+    }
+  else
+    {
+      /* this is the default return value: we cannot know if a class
+       * is going to paint outside its allocation, so we take the
+       * conservative approach.
+       */
+      res = FALSE;
+    }
 
   /* we start from the allocation */
   clutter_paint_volume_set_width (volume,



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