From 2235e705859a880415da4d57c76596cef0b9026f Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 7 Sep 2010 23:09:06 +0100 Subject: [PATCH] actor: don't immediately queue redraw when queuing relayout We have bent the originally documented semantics a bit so now where we say "Queueing a new layout automatically queues a redraw as well" it might be clearer to say "Queuing a new layout implicitly queues a redraw as well if anything in the layout changes". This should be close enough to the original semantics to not cause any problems. Without this change then we we fail to take advantage of clipped redraws in a lot of cases because queuing a redraw with priv->needs_allocation == TRUE will automatically be promoted to a full stage redraw since it's not possible to determine a valid paint-volume. Also queuing a redraw here will end up registering a redundant clipped redraw for the current location, doing quite a lot of redundant transforms, and then later when re-allocated during layouting another queue redraw would happen with the correct paint-volume. --- clutter/clutter-actor.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index b2a402e74..bf58f9577 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -5200,7 +5200,27 @@ clutter_actor_queue_relayout (ClutterActor *self) { _clutter_actor_queue_only_relayout (self); + /* XXX: We have bent the originally documented semantics a bit so + * now where we say "Queueing a new layout automatically queues + * a redraw as well" it might be clearer to say "Queuing a new + * layout implicitly queues a redraw as well if anything in the + * layout changes". + * + * If we don't comment this out then we fail to take advantage + * of clipped redraws in a lot of cases because queuing a redraw + * with priv->needs_allocation == TRUE will automatically be + * promoted to a full stage redraw since it's not possible to + * determine a valid paint-volume. + * + * It doesn't just work to do the queue redraw first. I didn't debug + * why in detail but at the very least it would end up registering a + * redundant clipped redraw for the current location, doing quite a + * lot of redundant transforms, and then later when allocated + * another queue redraw will happen with the correct paint-volume. + */ +#if 0 clutter_actor_queue_redraw (self); +#endif } /**