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



commit ccb740f167b4a120f16c83bdd3165e8251f0e62a
Author: Robert Bragg <robert linux intel com>
Date:   Mon Aug 15 18:24:32 2011 +0100

    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>

 clutter/clutter-actor.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 732c5f4..538f95c 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]