summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-08-08 17:03:31 +0100
committerRobin Watts <robin.watts@artifex.com>2017-10-24 15:16:36 +0100
commite9387d19a9e12ed5b4148059f9ae7c140274ab2e (patch)
treec71d6371d6085e5dd6cba5f7fbd78163f0f74380 /source
parent084885ab5668a716ed68093b7308b7f0beecbd54 (diff)
downloadmupdf-e9387d19a9e12ed5b4148059f9ae7c140274ab2e.tar.xz
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.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/draw-device.c23
1 files changed, 5 insertions, 18 deletions
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];
}