[mutter/wip/carlosg/clip-me-harder: 543/548] compositor: Optimize shadows entirely if clip region is empty



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

    compositor: 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.

 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]