From 1a669fc0661b101e913696556714fedd597fa73d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 21 Mar 2011 18:46:32 +0100 Subject: [PATCH] image: Don't use the fast path if it's wrong Fixes the new "operator-source" test and the original report from: http://lists.cairographics.org/archives/cairo/2011-March/021827.html I tested this code path with all operators and "source" is the only one which causes issues due to rendering outside of the boxes. Signed-off-by: Uli Schlachter --- src/cairo-image-surface.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 2a421b7..e00f6d9 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -2781,6 +2781,12 @@ _composite_unaligned_boxes (cairo_image_surface_t *dst, const struct _cairo_boxes_chunk *chunk; int i, src_x, src_y; + /* The below code breaks for unaligned boxes with operator source. This can + * best be seen with multiple boxes where black is drawn to dst outside of + * the boxes. */ + if (op == CAIRO_OPERATOR_SOURCE && ! boxes->is_pixel_aligned) + return CAIRO_INT_STATUS_UNSUPPORTED; + i = CAIRO_STRIDE_FOR_WIDTH_BPP (extents->bounded.width, 8) * extents->bounded.height; if ((unsigned) i <= sizeof (buf)) { mask = pixman_image_create_bits (PIXMAN_a8, -- 1.7.4.1