[clutter] actor: Return a valid paint volume by default



commit 7fffb7290e9fa840912a14da8102be9a83143226
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Thu Apr 12 17:24:37 2012 +0100

    actor: Return a valid paint volume by default
    
    It's been a year and change, and two stable releases, since we
    introduced the paint volume mechanism to allow actors to paint outside
    their allocation safely in environments that support clipped redraws.
    
    The time has come to flip the switch, and return a valid paint volume,
    matching the actor's allocation, by default - at least for Actor
    instances from classes that do not override paint() and
    get_paint_volume().
    
    If an actor has a paint signal handler then it's the user responsability
    not to paint outside the allocation - and to suffer the consequences of
    doing so; in an ideal world, paint() would not be a signal in the first
    place anyway. Plus, the idea that painting can happen at any time and
    still have a valid surface greatly conflicts with the design goal of
    making Clutter's rendering operations fully retained into a render tree.
    
    We can still revert this commit before spinning 1.12, if need be.

 clutter/clutter-actor.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 5ac4814..33095c6 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -5153,7 +5153,7 @@ clutter_actor_update_default_paint_volume (ClutterActor       *self,
                                            ClutterPaintVolume *volume)
 {
   ClutterActorPrivate *priv = self->priv;
-  gboolean res = FALSE;
+  gboolean res = TRUE;
 
   /* we start from the allocation */
   clutter_paint_volume_set_width (volume,
@@ -5253,10 +5253,13 @@ clutter_actor_real_get_paint_volume (ClutterActor       *self,
       res = FALSE;
     }
 
-  if (clutter_actor_update_default_paint_volume (self, volume))
-    return res;
+  /* update_default_paint_volume() should only fail if one of the children
+   * reported an invalid, or no, paint volume
+   */
+  if (!clutter_actor_update_default_paint_volume (self, volume))
+    return FALSE;
 
-  return FALSE;
+  return res;
 }
 
 /**



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