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.
This commit is contained in:
Emmanuele Bassi 2012-04-12 17:24:37 +01:00
parent 0bf5008159
commit 7fffb7290e

View File

@ -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 res;
}
/**