From 84632d9c1d54d6902bee42bb9a1aa9f4bf773a90 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 14 Feb 2012 15:43:38 -0500 Subject: [PATCH] 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 file changed, 19 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index fb2269b4c..2c1b21221 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,