From 964229acf420d690f4d30156e6e700900911e5ff Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 9 Oct 2020 16:34:32 -0300 Subject: [PATCH] clutter/actor: Trivial code shuffling Retrieving the stage from the actor is almost free, but this is a hot path anyway and we can bail out before that. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489 --- clutter/clutter/clutter-actor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 59b5fa207..3c0aa422c 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -3457,9 +3457,6 @@ cull_actor (ClutterActor *self, if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CULLING)) return FALSE; - stage = (ClutterStage *) _clutter_actor_get_stage_internal (self); - stage_clip = _clutter_stage_get_clip (stage); - if (clutter_paint_context_is_drawing_off_stage (paint_context)) { CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): " @@ -3468,6 +3465,9 @@ cull_actor (ClutterActor *self, return FALSE; } + stage = (ClutterStage *) _clutter_actor_get_stage_internal (self); + stage_clip = _clutter_stage_get_clip (stage); + *result_out = _clutter_paint_volume_cull (&priv->last_paint_volume, stage_clip);