[cairo-commit] cairo/src cairo-pattern.c,1.49,1.50

Carl Worth commit at pdx.freedesktop.org
Thu Jul 14 15:47:20 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv4208/src

Modified Files:
	cairo-pattern.c 
Log Message:

        * src/cairo-pattern.c: (_cairo_pattern_acquire_surfaces): Fix up
        one more call to _cairo_pattern_release_surface missed in the
        previous commit.


Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- cairo-pattern.c	14 Jul 2005 22:10:48 -0000	1.49
+++ cairo-pattern.c	14 Jul 2005 22:47:18 -0000	1.50
@@ -1452,7 +1452,7 @@
 				 cairo_surface_attributes_t *mask_attributes)
 {
     cairo_int_status_t	  status;
-    cairo_pattern_union_t tmp;
+    cairo_pattern_union_t src_tmp, mask_tmp;
 
     if (src->status)
 	return src->status;
@@ -1475,46 +1475,44 @@
 	combined = src_solid->color;
 	_cairo_color_multiply_alpha (&combined, mask_solid->color.alpha);
 
-	_cairo_pattern_init_solid (&tmp.solid, &combined);
+	_cairo_pattern_init_solid (&src_tmp.solid, &combined);
 
 	mask = NULL;
     }
     else
     {
-	_cairo_pattern_init_copy (&tmp.base, src);
+	_cairo_pattern_init_copy (&src_tmp.base, src);
     }
 
-    status = _cairo_pattern_acquire_surface (&tmp.base, dst,
+    status = _cairo_pattern_acquire_surface (&src_tmp.base, dst,
 					     src_x, src_y,
 					     width, height,
 					     src_out, src_attributes);
-
-    _cairo_pattern_fini (&tmp.base);
-
-    if (status)
+    if (status) {
+	_cairo_pattern_fini (&src_tmp.base);
 	return status;
+    }
 
-    if (mask)
+    if (mask == NULL)
     {
-	_cairo_pattern_init_copy (&tmp.base, mask);
+	_cairo_pattern_fini (&src_tmp.base);
+	*mask_out = NULL;
+	return CAIRO_STATUS_SUCCESS;
+    }
+
+    _cairo_pattern_init_copy (&mask_tmp.base, mask);
 	
-	status = _cairo_pattern_acquire_surface (&tmp.base, dst,
-						 mask_x, mask_y,
-						 width, height,
-						 mask_out, mask_attributes);
+    status = _cairo_pattern_acquire_surface (&mask_tmp.base, dst,
+					     mask_x, mask_y,
+					     width, height,
+					     mask_out, mask_attributes);
     
-	_cairo_pattern_fini (&tmp.base);
+    if (status)
+	_cairo_pattern_release_surface (&src_tmp.base,
+					*src_out, src_attributes);
 
-	if (status)
-	{
-	    _cairo_pattern_release_surface (dst, *src_out, src_attributes);
-	    return status;
-	}
-    }
-    else
-    {
-	*mask_out = NULL;
-    }
+    _cairo_pattern_fini (&src_tmp.base);
+    _cairo_pattern_fini (&mask_tmp.base);
 
-    return CAIRO_STATUS_SUCCESS;
+    return status;
 }




More information about the cairo-commit mailing list