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
This commit is contained in:
Robert Bragg 2010-09-30 11:18:23 +01:00
parent 471659ed4b
commit fba6335291

View File

@ -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)