diff options
author | Benjamin Otte <otte@redhat.com> | 2010-04-28 12:26:29 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-04-28 13:15:09 +0200 |
commit | 2a91d425088cb8a93de76f2f91f32a7f23f0aecd (patch) | |
tree | 00c6e4f40025eaf5433e0adb8df01e12f4a3fd43 /src/cairo-surface-fallback.c | |
parent | bb853916f3581af13cc1abff185ef5e0218f9f1e (diff) | |
download | cairo-2a91d425088cb8a93de76f2f91f32a7f23f0aecd.tar.gz |
fallback: Fix clip_region handling in mask creation
Fixes the xlib-expose-event test.
Diffstat (limited to 'src/cairo-surface-fallback.c')
-rw-r--r-- | src/cairo-surface-fallback.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c index 801ed56f5..36ff66723 100644 --- a/src/cairo-surface-fallback.c +++ b/src/cairo-surface-fallback.c @@ -127,7 +127,7 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern, const cairo_rectangle_int_t *extents) { cairo_surface_t *mask; - cairo_region_t *clip_region = NULL; + cairo_region_t *clip_region = NULL, *fallback_region = NULL; cairo_status_t status; cairo_bool_t clip_surface = FALSE; @@ -153,6 +153,18 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern, if (unlikely (mask->status)) return mask->status; + if (clip_region && (extents->x || extents->y)) { + fallback_region = cairo_region_copy (clip_region); + status = fallback_region->status; + if (unlikely (status)) + goto CLEANUP_SURFACE; + + cairo_region_translate (fallback_region, + -extents->x, + -extents->y); + clip_region = fallback_region; + } + status = draw_func (draw_closure, CAIRO_OPERATOR_ADD, &_cairo_pattern_white.base, mask, extents->x, extents->y, @@ -167,6 +179,8 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern, _cairo_pattern_init_for_surface (mask_pattern, mask); CLEANUP_SURFACE: + if (fallback_region) + cairo_region_destroy (fallback_region); cairo_surface_destroy (mask); return status; |