[cairo-commit] cairo/src cairo-gstate.c,1.151,1.152

Carl Worth commit at pdx.freedesktop.org
Thu Jul 28 15:58:11 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-gstate.c 
Log Message:

        * src/cairo-gstate.c: (_cairo_gstate_mask): Run the mask pattern
        through the CTM in the same way as the source pattern. This fixes
        the bug demonstrated by the mask-ctm and mask-surface-ctm tests so
        they should no longer fail.


Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- cairo-gstate.c	28 Jul 2005 16:46:38 -0000	1.151
+++ cairo-gstate.c	28 Jul 2005 22:58:09 -0000	1.152
@@ -877,7 +877,7 @@
 		    cairo_pattern_t *mask)
 {
     cairo_rectangle_t extents;
-    cairo_pattern_union_t pattern;
+    cairo_pattern_union_t source_pattern, mask_pattern;
     cairo_surface_pattern_t intermediate_pattern;
     cairo_pattern_t *effective_mask;
     cairo_status_t status;
@@ -937,12 +937,15 @@
 	mask_x = mask_y = 0;
     }
 
-    _cairo_pattern_init_copy (&pattern.base, gstate->source);
-    _cairo_gstate_pattern_transform (gstate, &pattern.base);
+    _cairo_pattern_init_copy (&source_pattern.base, gstate->source);
+    _cairo_gstate_pattern_transform (gstate, &source_pattern.base);
+
+    _cairo_pattern_init_copy (&mask_pattern.base, effective_mask);
+    _cairo_gstate_pattern_transform (gstate, &mask_pattern.base);
 
     status = _cairo_surface_composite (gstate->operator,
-				       &pattern.base,
-				       effective_mask,
+				       &source_pattern.base,
+				       &mask_pattern.base,
 				       gstate->target,
 				       extents.x,          extents.y,
 				       extents.x - mask_x, extents.y - mask_y,
@@ -951,7 +954,8 @@
 
     if (gstate->clip.surface)
 	_cairo_pattern_fini (&intermediate_pattern.base);
-    _cairo_pattern_fini (&pattern.base);
+    _cairo_pattern_fini (&source_pattern.base);
+    _cairo_pattern_fini (&mask_pattern.base);
 
     return status;
 }




More information about the cairo-commit mailing list