[mutter/gnome-3-36] wayland/actor-surface: Always set opaque region on alpha-less textures



commit 396d24adc0fadcd213627fb6eefc757b3a4d948b
Author: Robert Mader <robert mader posteo de>
Date:   Thu Oct 1 00:33:45 2020 +0200

    wayland/actor-surface: Always set opaque region on alpha-less textures
    
    Wayland clients using buffers without alpha channel are not expected to
    set an opaque region. However, we rely on the opaque region for the fast
    painting path in `MetaShapedTexture`.
    
    Thus, make sure to always set an opaque region internally in those cases.
    For X11 clients, wo do so already.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463
    
    (cherry picked from commit 71f03a718d4312589dd7048299ed1f32e740c4fa)

 src/wayland/meta-wayland-actor-surface.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index f631f63cef..f4b9586738 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -222,7 +222,15 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
 
   if (!META_IS_XWAYLAND_SURFACE (surface_role))
     {
-      if (surface->opaque_region)
+      if (!meta_shaped_texture_has_alpha (stex))
+        {
+          cairo_region_t *opaque_region;
+
+          opaque_region = cairo_region_create_rectangle (&surface_rect);
+          meta_surface_actor_set_opaque_region (surface_actor, opaque_region);
+          cairo_region_destroy (opaque_region);
+        }
+      else if (surface->opaque_region)
         {
           cairo_region_t *opaque_region;
 


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