[mutter] shaped-texture: Clean up set_opaque_region()



commit 1142f06af52d18b5aeb70ad2e60f7a69c4076d7d
Author: Robert Mader <robert mader posteo de>
Date:   Mon Jun 29 12:57:14 2020 +0200

    shaped-texture: Clean up set_opaque_region()
    
    Make the code more consistent with similar functions elsewhere
    and save a few cycles by removing the type check.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1334

 src/compositor/meta-shaped-texture.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 630efb8df4..2d7facaa0d 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -1076,15 +1076,9 @@ void
 meta_shaped_texture_set_opaque_region (MetaShapedTexture *stex,
                                        cairo_region_t    *opaque_region)
 {
-  g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
-
-  if (stex->opaque_region)
-    cairo_region_destroy (stex->opaque_region);
-
+  g_clear_pointer (&stex->opaque_region, cairo_region_destroy);
   if (opaque_region)
     stex->opaque_region = cairo_region_reference (opaque_region);
-  else
-    stex->opaque_region = NULL;
 }
 
 cairo_region_t *


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