[mutter] clutter/actor: Pass stage as user_data when unrealizing



commit 249274c67705614fa14c95808283d14a38302fba
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Jul 6 21:33:32 2020 +0200

    clutter/actor: Pass stage as user_data when unrealizing
    
    We can avoid having to get the stage again for every child of the
    subtree we're unrealizing by getting the stage once and passing it as
    user_data to the callbacks.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1356

 clutter/clutter/clutter-actor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index d3ca1b22d7..9bafacac52 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -2201,7 +2201,7 @@ unrealize_actor_after_children_cb (ClutterActor *self,
                                    int depth,
                                    void *user_data)
 {
-  ClutterActor *stage = _clutter_actor_get_stage_internal (self);
+  ClutterActor *stage = user_data;
 
   /* We want to unset the realized flag only _after_
    * child actors are unrealized, to maintain invariants.
@@ -2244,11 +2244,13 @@ unrealize_actor_after_children_cb (ClutterActor *self,
 static void
 clutter_actor_unrealize_not_hiding (ClutterActor *self)
 {
+  ClutterActor *stage = _clutter_actor_get_stage_internal (self);
+
   _clutter_actor_traverse (self,
                            CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST,
                            unrealize_actor_before_children_cb,
                            unrealize_actor_after_children_cb,
-                           NULL);
+                           stage);
 }
 
 /*


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