diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/cairo-gstate.c | 16 |
2 files changed, 17 insertions, 6 deletions
@@ -1,5 +1,12 @@ 2005-07-28 Carl Worth <cworth@cworth.org> + * 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. + +2005-07-28 Carl Worth <cworth@cworth.org> + * test/.cvsignore: * test/Makefile.am: * test/mask-ctm-ref.png: diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index ed3359b99..50a6f2d26 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -877,7 +877,7 @@ _cairo_gstate_mask (cairo_gstate_t *gstate, 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 @@ _cairo_gstate_mask (cairo_gstate_t *gstate, 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 @@ _cairo_gstate_mask (cairo_gstate_t *gstate, 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; } |