From 7fffb7290e9fa840912a14da8102be9a83143226 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 12 Apr 2012 17:24:37 +0100 Subject: [PATCH] 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 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 5ac481431..33095c6b1 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; } /**