actor: Don't update last-paint-volume during picking

Actually this change has two notable effects; firstly we no longer
perform culling during picking and secondly we avoid updating the
last-paint-volume of an actor when picking.

We shouldn't perform culling during picking until clutter-stage.c is
updated to setup the clipping planes appropriately.

Since the last-paint-volume is intended to represent the visible region
of the actor the last time it was painted on screen it doesn't make
sense to update this during off screen pick renders since we are liable
to end up with a last-paint-volume that maps to an actors new position
when we next come to paint for real.

This fixes a bug in gnome-shell with dragging dash icons leaving a
messy trail on the screen.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-08-15 18:24:32 +01:00
parent 46b683cd2b
commit ccb740f167

View File

@ -2916,8 +2916,19 @@ clutter_actor_paint (ClutterActor *self)
* XXX: We are starting to do a lot of vertex transforms on
* the CPU in a typical paint, so at some point we should
* audit these and consider caching some things.
*
* NB: We don't perform culling while picking at this point because
* clutter-stage.c doesn't setup the clipping planes appropriately.
*
* NB: We don't want to update the last-paint-volume during picking
* because the last-paint-volume is used to determine the old screen
* space location of an actor that has moved so we can know the
* minimal region to redraw to clear an old view of the actor. If we
* update this during picking then by the time we come around to
* paint then the last-paint-volume would likely represent the new
* actor position not the old.
*/
if (!in_clone_paint ())
if (!in_clone_paint () && pick_mode == CLUTTER_PICK_NONE)
{
gboolean success;
/* annoyingly gcc warns if uninitialized even though
@ -2933,8 +2944,7 @@ clutter_actor_paint (ClutterActor *self)
success = cull_actor (self, &result);
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS &&
pick_mode == CLUTTER_PICK_NONE))
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS))
_clutter_actor_paint_cull_result (self, success, result);
else if (result == CLUTTER_CULL_RESULT_OUT && success)
goto done;