[cairo-commit] src/cairo-gl-traps-compositor.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Feb 9 15:28:03 PST 2012


 src/cairo-gl-traps-compositor.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 38bf7a6526e378175b62b9c0eb92ce65c5d0e630
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 9 23:26:14 2012 +0000

    gl: Transfer ownership of trapezoid mask to operand
    
    Signed-off-by: Henry (Yu) Song <hsong at sisa.samsung.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-traps-compositor.c b/src/cairo-gl-traps-compositor.c
index 60a7331..0fb7c4c 100644
--- a/src/cairo-gl-traps-compositor.c
+++ b/src/cairo-gl-traps-compositor.c
@@ -310,10 +310,8 @@ traps_to_operand (void *_dst,
 					   extents->width, extents->height,
 					   0, 0);
     cairo_surface_destroy (image);
-    if (unlikely (status)) {
-	cairo_surface_destroy (mask);
-	return status;
-    }
+    if (unlikely (status))
+	goto error;
 
     _cairo_pattern_init_for_surface (&pattern, mask);
     cairo_matrix_init_translate (&pattern.base.matrix,
@@ -324,8 +322,15 @@ traps_to_operand (void *_dst,
 				     &_cairo_unbounded_rectangle,
 				     &_cairo_unbounded_rectangle);
     _cairo_pattern_fini (&pattern.base);
-    cairo_surface_destroy (mask);
 
+    if (unlikely (status))
+	goto error;
+
+    operand->texture.owns_surface = mask;
+    return CAIRO_STATUS_SUCCESS;
+
+error:
+    cairo_surface_destroy (mask);
     return status;
 }
 


More information about the cairo-commit mailing list