[mutter] clutter/actor: Use a variable to check if culling is allowed



commit 58930e9e1f9abb6f24190105b6ac0610fbdc62f0
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Wed Nov 25 00:51:15 2020 +0100

    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>

 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 f00ce35b13..20070df4e4 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);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]