From 58930e9e1f9abb6f24190105b6ac0610fbdc62f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 25 Nov 2020 00:51:15 +0100 Subject: [PATCH] clutter/actor: Use a variable to check if culling is allowed Since we now want to check whether culling is force-disabled using a debug flag in two places, let's factor this out into a separate variable. Part-of: --- clutter/clutter/clutter-actor.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index f00ce35b1..20070df4e 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -3637,6 +3637,11 @@ clutter_actor_paint (ClutterActor *self, g_autoptr (ClutterPaintNode) root_node = NULL; ClutterActorPrivate *priv; ClutterActorBox clip; + gboolean should_cull_out = (clutter_paint_debug_flags & + (CLUTTER_DEBUG_DISABLE_CULLING | + CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)) != + (CLUTTER_DEBUG_DISABLE_CULLING | + CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS); gboolean culling_inhibited; gboolean clip_set = FALSE; @@ -3792,11 +3797,7 @@ clutter_actor_paint (ClutterActor *self, * the initialization is redundant :-( */ ClutterCullResult result = CLUTTER_CULL_RESULT_IN; - if (G_LIKELY ((clutter_paint_debug_flags & - (CLUTTER_DEBUG_DISABLE_CULLING | - CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)) != - (CLUTTER_DEBUG_DISABLE_CULLING | - CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS))) + if (should_cull_out) _clutter_actor_update_last_paint_volume (self); success = cull_actor (self, paint_context, &result); @@ -3828,13 +3829,7 @@ clutter_actor_paint (ClutterActor *self, */ if (!priv->children_painted) { - if (!culling_inhibited && - !in_clone_paint () && - G_LIKELY ((clutter_paint_debug_flags & - (CLUTTER_DEBUG_DISABLE_CULLING | - CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)) != - (CLUTTER_DEBUG_DISABLE_CULLING | - CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS))) + if (!culling_inhibited && !in_clone_paint () && should_cull_out) ensure_last_paint_volumes_updated (self); }