summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2020-11-25 00:51:15 +0100
committerJonas Dreßler <verdre@v0yd.nl>2020-11-25 01:08:02 +0100
commit58930e9e1f9abb6f24190105b6ac0610fbdc62f0 (patch)
tree8fbf5aa44303ce63a20d03b7ae278d9b68d9ce2e /clutter
parent0320649a1c50993f308344e0dd296abaad0ee6d4 (diff)
downloadmutter-58930e9e1f9abb6f24190105b6ac0610fbdc62f0.tar.gz
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1591>
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter/clutter-actor.c19
1 files 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);
}