[mutter] clutter/actor: Avoid some stage view updates



commit 7e7a639cc5132cf3355e861235f325540fe56548
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Oct 13 13:28:58 2022 +0200

    clutter/actor: Avoid some stage view updates
    
    We traverse the whole screnegraph anyway these days in finish_layout(),
    so no need for the whole "set the flag on parents even though we don't
    need it" dance anymore.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2667>

 clutter/clutter/clutter-actor.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 4d1856ef77..009488a069 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1484,22 +1484,6 @@ clutter_actor_update_map_state (ClutterActor  *self,
 #endif
 }
 
-static void
-queue_update_stage_views (ClutterActor *actor)
-{
-  while (actor && !actor->priv->needs_update_stage_views)
-    {
-      actor->priv->needs_update_stage_views = TRUE;
-
-      /* We don't really need to update the stage-views of the actors up the
-       * hierarchy, we set the flag anyway though so we can avoid traversing
-       * the whole scenegraph when looking for actors which need an update
-       * in clutter_actor_finish_layout().
-       */
-      actor = actor->priv->parent;
-    }
-}
-
 static void queue_update_paint_volume (ClutterActor *actor);
 
 static void
@@ -1544,18 +1528,6 @@ clutter_actor_real_map (ClutterActor *self)
 
   if (priv->unmapped_paint_branch_counter == 0)
     {
-      /* We skip unmapped actors when updating the stage-views list, so if
-       * an actors list got invalidated while it was unmapped make sure to
-       * set priv->needs_update_stage_views to TRUE for all actors up the
-       * hierarchy now.
-       */
-      if (priv->needs_update_stage_views)
-        {
-          /* Avoid the early return in queue_update_stage_views() */
-          priv->needs_update_stage_views = FALSE;
-          queue_update_stage_views (self);
-        }
-
       /* Avoid the early return in clutter_actor_queue_relayout() */
       priv->needs_width_request = FALSE;
       priv->needs_height_request = FALSE;
@@ -2507,7 +2479,7 @@ clutter_actor_notify_if_geometry_changed (ClutterActor          *self,
 static void
 absolute_geometry_changed (ClutterActor *actor)
 {
-  queue_update_stage_views (actor);
+  actor->priv->needs_update_stage_views = TRUE;
 }
 
 static ClutterActorTraverseVisitFlags


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