[mutter] surface-actor: Cull out surfaces without alpha channel



commit 372d73e2757b6d73e72be08af515727205f301b6
Author: Robert Mader <robert mader posteo de>
Date:   Sun Feb 23 16:37:50 2020 +0100

    surface-actor: Cull out surfaces without alpha channel
    
    If a opaque region is explicitly set we should not consider the surface
    opaque, as that implies e.g. a shape region is set.
    
    If no opque region is set but the texture does not have an alpha channel,
    we can savely cull it out.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082

 src/compositor/meta-surface-actor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 15bf24c07..02b7af2fc 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -274,6 +274,18 @@ meta_surface_actor_cull_out (MetaCullable   *cullable,
 
       opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
 
+      if (!opaque_region && meta_shaped_texture_is_opaque (priv->texture))
+        {
+          cairo_rectangle_int_t rect;
+
+          rect = (cairo_rectangle_int_t) {
+            .width = meta_shaped_texture_get_width (priv->texture),
+            .height = meta_shaped_texture_get_height (priv->texture)
+          };
+
+          opaque_region = cairo_region_create_rectangle (&rect);
+        }
+
       if (!opaque_region)
         return;
 


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