[mutter] window-actor: Also cull out clip_region



commit a8cb84c711d7497a8bd34daae4b9127bd14fe3d4
Author: Robert Mader <robert mader posteo de>
Date:   Sat Dec 21 15:34:14 2019 +0100

    window-actor: Also cull out clip_region
    
    From `meta_cullable_cull_out`:
    ```
    Actors that may have fully opaque parts should also subtract out a region
    that is fully opaque from @unobscured_region and @clip_region.
    ```
    
    As we do no check for the intersection of these two elsewhere in the code,
    let's substract from the clip region, too.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/985

 src/compositor/meta-window-actor.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index a42dfaf7b..3ebfc81e6 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -957,20 +957,28 @@ meta_window_actor_cull_out (MetaCullable   *cullable,
 
   meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
 
-  if (unobscured_region && meta_window_actor_is_opaque (self))
+  if ((unobscured_region || clip_region) && meta_window_actor_is_opaque (self))
     {
       cairo_region_t *region = meta_window_get_frame_bounds (priv->window);
 
       if (region)
         {
-          cairo_region_subtract (unobscured_region, region);
+          if (unobscured_region)
+            cairo_region_subtract (unobscured_region, region);
+          if (clip_region)
+            cairo_region_subtract (clip_region, region);
         }
       else
         {
           cairo_rectangle_int_t rect;
+
           meta_window_get_frame_rect (priv->window, &rect);
           rect.x = rect.y = 0;
-          cairo_region_subtract_rectangle (unobscured_region, &rect);
+
+          if (unobscured_region)
+            cairo_region_subtract_rectangle (unobscured_region, &rect);
+          if (clip_region)
+            cairo_region_subtract_rectangle (clip_region, &rect);
         }
     }
 }


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