From 717b857bd8e9142354dfac4107946e8179eda2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 16 Oct 2020 23:27:04 +0200 Subject: clutter/actor: Use separate priv pointer in clutter_actor_real_(un)map We're accessing self->priv quite often in those functions, it makes sense to use a separate variable for it. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1366 --- clutter/clutter/clutter-actor.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index dd92a675c..8fde0f550 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -1610,6 +1610,7 @@ queue_update_stage_views (ClutterActor *actor) static void clutter_actor_real_map (ClutterActor *self) { + ClutterActorPrivate *priv = self->priv; ClutterActor *iter; g_assert (!CLUTTER_ACTOR_IS_MAPPED (self)); @@ -1619,19 +1620,19 @@ clutter_actor_real_map (ClutterActor *self) CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_MAPPED); - if (self->priv->unmapped_paint_branch_counter == 0) + if (priv->unmapped_paint_branch_counter == 0) { - self->priv->needs_paint_volume_update = TRUE; + priv->needs_paint_volume_update = TRUE; /* 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 (self->priv->needs_update_stage_views) + if (priv->needs_update_stage_views) { /* Avoid the early return in queue_update_stage_views() */ - self->priv->needs_update_stage_views = FALSE; + priv->needs_update_stage_views = FALSE; queue_update_stage_views (self); } } @@ -1641,7 +1642,7 @@ clutter_actor_real_map (ClutterActor *self) */ g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_MAPPED]); - for (iter = self->priv->first_child; + for (iter = priv->first_child; iter != NULL; iter = iter->priv->next_sibling) { @@ -1725,7 +1726,7 @@ clutter_actor_real_unmap (ClutterActor *self) CLUTTER_NOTE (ACTOR, "Unmapping actor '%s'", _clutter_actor_get_debug_name (self)); - for (iter = self->priv->first_child; + for (iter = priv->first_child; iter != NULL; iter = iter->priv->next_sibling) { @@ -1734,7 +1735,7 @@ clutter_actor_real_unmap (ClutterActor *self) CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_MAPPED); - if (self->priv->unmapped_paint_branch_counter == 0) + if (priv->unmapped_paint_branch_counter == 0) { /* clear the contents of the last paint volume, so that hiding + moving + * showing will not result in the wrong area being repainted -- cgit v1.2.1