[mutter] shaped-texture: Prevent no clip region from being used as an empty clip region



commit 23e9947f7a022fe275abd2f52d6368192b1622dd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 29 15:13:39 2013 -0400

    shaped-texture: Prevent no clip region from being used as an empty clip region
    
    cairo_region_copy, while valid to call on a NULL pointer, gives us an empty
    region instead of an infinitely big region, so the interesction won't give
    us what we want. Just check for this case explicitly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707081

 src/compositor/meta-shaped-texture.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 715cc3c..98b9bd6 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -257,8 +257,15 @@ meta_shaped_texture_paint (ClutterActor *actor)
       int n_rects;
       int i;
 
-      region = cairo_region_copy (priv->clip_region);
-      cairo_region_intersect (region, priv->opaque_region);
+      if (priv->clip_region != NULL)
+        {
+          region = cairo_region_copy (priv->clip_region);
+          cairo_region_intersect (region, priv->opaque_region);
+        }
+      else
+        {
+          region = cairo_region_reference (priv->opaque_region);
+        }
 
       if (cairo_region_is_empty (region))
         goto paint_blended;


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