From fba633529148e65b9e136ea082fa7f853b789d96 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 30 Sep 2010 11:18:23 +0100 Subject: [PATCH] actor: don't ignore clip for clipped redraws In all the changes made recently to how we handle redraws and adding support for paint-volumes we stopped looking at explicit clip regions passed to _clutter_actor_queue_redraw_with_clip. In _clutter_actor_finish_queue_redraw we had started always trying to clip the redraw to the paint-volume of the actor, but forgot to consider that the user may have already determined the clip region for us! Now we first check if the given clip != NUll and if so we don't need to calculate the paint-volume of the actor. http://bugzilla.clutter-project.org/show_bug.cgi?id=2349 --- clutter/clutter-actor.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 946d9cdae..c20907584 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -4905,7 +4905,11 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self, const ClutterPaintVolume *pv; gboolean clipped; - /* The idea is that if we know the paint box for where the actor was + /* If we've been explicitly passed a clip volume then there's + * nothing more to calculate, but otherwhise the only thing we know + * is that the change is constrained to the given actor. + * + * The idea is that if we know the paint box for where the actor was * last drawn and we also have the paint volume for where it will be * drawn next then if we queue a redraw for both these regions that * will cover everything that needs to be redrawn to clear the old @@ -4915,7 +4919,12 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self, * the previous redraw since we don't know where to set the clip so * it will clear the actor as it is currently. */ - if (G_LIKELY (priv->last_paint_box_valid)) + if (clip) + { + _clutter_actor_set_queue_redraw_clip (self, clip); + clipped = TRUE; + } + else if (G_LIKELY (priv->last_paint_box_valid)) { pv = clutter_actor_get_paint_volume (self); if (pv)