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.
This commit is contained in:
Jasper St. Pierre 2012-02-14 15:43:38 -05:00
parent 114250e329
commit 84632d9c1d

View File

@ -4687,13 +4687,28 @@ clutter_actor_real_get_paint_volume (ClutterActor *self,
{ {
ClutterActorPrivate *priv = self->priv; ClutterActorPrivate *priv = self->priv;
ClutterActor *child; ClutterActor *child;
ClutterActorClass *klass;
gboolean res; gboolean res;
/* this is the default return value: we cannot know if a class klass = CLUTTER_ACTOR_GET_CLASS (self);
* is going to paint outside its allocation, so we take the
* conservative approach. /* 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 */ /* we start from the allocation */
clutter_paint_volume_set_width (volume, clutter_paint_volume_set_width (volume,