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
This commit is contained in:
Georges Basile Stavracas Neto 2020-10-09 16:34:32 -03:00
parent 01ccc54ce8
commit 964229acf4

View File

@ -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);