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
This commit is contained in:
Jonas Dreßler 2020-07-06 21:33:32 +02:00 committed by verdre
parent ae83a61e67
commit 249274c677

View File

@ -2201,7 +2201,7 @@ unrealize_actor_after_children_cb (ClutterActor *self,
int depth, int depth,
void *user_data) void *user_data)
{ {
ClutterActor *stage = _clutter_actor_get_stage_internal (self); ClutterActor *stage = user_data;
/* We want to unset the realized flag only _after_ /* We want to unset the realized flag only _after_
* child actors are unrealized, to maintain invariants. * child actors are unrealized, to maintain invariants.
@ -2244,11 +2244,13 @@ unrealize_actor_after_children_cb (ClutterActor *self,
static void static void
clutter_actor_unrealize_not_hiding (ClutterActor *self) clutter_actor_unrealize_not_hiding (ClutterActor *self)
{ {
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
_clutter_actor_traverse (self, _clutter_actor_traverse (self,
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST, CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST,
unrealize_actor_before_children_cb, unrealize_actor_before_children_cb,
unrealize_actor_after_children_cb, unrealize_actor_after_children_cb,
NULL); stage);
} }
/* /*