[mutter/wip/carlosg/clip-me-harder: 5/10] shadow-factory: Optimize shadows entirely if clip region is empty



commit 2812338b7a7a32dc60e1ebf2182a4d8ce64f82bb
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 27 15:42:55 2019 +0100

    shadow-factory: Optimize shadows entirely if clip region is empty
    
    If the clip region is empty, we don't need to check the 9 slices
    separately, nothing will be painted anyway.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/698

 src/compositor/meta-shadow-factory.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index aa83b8629..ee94e2b4c 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -218,6 +218,9 @@ meta_shadow_paint (MetaShadow      *shadow,
   int n_x, n_y;
   gboolean source_updated = FALSE;
 
+  if (clip && cairo_region_is_empty (clip))
+    return;
+
   if (shadow->scale_width)
     {
       n_x = 3;


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