From e9387d19a9e12ed5b4148059f9ae7c140274ab2e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 8 Aug 2017 17:03:31 +0100 Subject: Clear isolated flag within 'inner' knockout groups. Knockout groups are only created temporarily, and this solves problems in Altona_Technical_v20_x4.pdf on page 7 on the 'B'. It seems reasonable that we shouldn't need to have isolated enabled here, because it's really required for blending the whole isolated group back. While we don't propagate "isolated" into "inner" knockout groups, we DO need to use the incoming isolated value to correctly establish the backdrop to use. --- source/fitz/draw-device.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index f67348d5..85c0b7e3 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -219,7 +219,7 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) fz_pixmap_bbox(ctx, state->dest, &bbox); fz_intersect_irect(&bbox, &state->scissor); - dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, &bbox, state->dest->seps, state->dest->alpha || isolated); + dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, &bbox, state->dest->seps, state->dest->alpha); if (isolated) { @@ -242,24 +242,11 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) fz_clear_pixmap(ctx, dest); } - if ((state->blendmode & FZ_BLEND_MODEMASK) == 0 && isolated) - { - /* We can render direct to any existing shape plane. If there - * isn't one, we don't need to make one. */ - shape = state->shape; - } - else - { - shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); - fz_clear_pixmap(ctx, shape); - } + shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + fz_clear_pixmap(ctx, shape); #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, ""); - { - char text[80]; - sprintf(text, "Knockout begin%s: background is ", isolated ? " (isolated)" : ""); - fz_dump_blend(ctx, text, dest); - } + fz_dump_blend(ctx, "Knockout begin: background is ", dest); if (shape) fz_dump_blend(ctx, "/", shape); printf("\n"); @@ -267,7 +254,7 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) state[1].scissor = bbox; state[1].dest = dest; state[1].shape = shape; - state[1].blendmode &= ~FZ_BLEND_MODEMASK; + state[1].blendmode &= ~(FZ_BLEND_MODEMASK | FZ_BLEND_ISOLATED); return &state[1]; } -- cgit v1.2.3