[mutter] cullable: Check if effects are disabled



commit aceadfe305144b2f2ed14d53022c716b69f9a0d3
Author: Robert Mader <robert mader posteo de>
Date:   Thu Feb 13 00:21:42 2020 +0100

    cullable: Check if effects are disabled
    
    Currently we skip culling actors if they have any effects set. But
    effects can be disabled, in which case we don't need to do that.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1052

 src/compositor/meta-cullable.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/meta-cullable.c b/src/compositor/meta-cullable.c
index 9f4f0a642..6f38c5e47 100644
--- a/src/compositor/meta-cullable.c
+++ b/src/compositor/meta-cullable.c
@@ -28,6 +28,22 @@
 
 G_DEFINE_INTERFACE (MetaCullable, meta_cullable, CLUTTER_TYPE_ACTOR);
 
+static gboolean
+has_active_effects (ClutterActor *actor)
+{
+  g_autoptr (GList) effects = NULL;
+  GList *l;
+
+  effects = clutter_actor_get_effects (actor);
+  for (l = effects; l != NULL; l = l->next)
+    {
+      if (clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (l->data)))
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
 /**
  * SECTION:meta-cullable
  * @title: MetaCullable
@@ -97,7 +113,7 @@ meta_cullable_cull_out_children (MetaCullable   *cullable,
        * as well for the same reason, but omitted for simplicity in the
        * hopes that no-one will do that.
        */
-      if (needs_culling && clutter_actor_has_effects (child))
+      if (needs_culling && has_active_effects (child))
         needs_culling = FALSE;
 
       if (needs_culling && !meta_cullable_is_untransformed (META_CULLABLE (child)))


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