diff options
author | Robin Watts <robin.watts@artifex.com> | 2017-12-06 16:38:00 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-12-06 17:07:55 +0000 |
commit | eb9afa2f46192b86352caded1ae56e79ed64dd4a (patch) | |
tree | 4b1a21d3d0fcb91cbdab4756fb4744c61d8650de /source | |
parent | b7749e563f93160de82c97fe34fb3fb0d3396304 (diff) | |
download | mupdf-eb9afa2f46192b86352caded1ae56e79ed64dd4a.tar.xz |
Bug 698801: Always copy background in when clipping an imagemask.
Don't attempt to rely on alpha, as it is incompatible with the way
we clip through the mask at the end.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/draw-device.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 55c9e408..09470ea5 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -1714,8 +1714,6 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m state = push_group_for_separations(ctx, dev, color_params, dev->default_cs); model = state->dest->colorspace; - model = state->dest->colorspace; - fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest, &clip), &state->scissor); if (image->w == 0 || image->h == 0) @@ -1992,15 +1990,8 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].mask); - /* When there is no alpha in the current destination (state[0].dest->alpha == 0) - * we have a choice. We can either create the new destination WITH alpha, or - * we can copy the old pixmap contents in. We opt for the latter here, but - * may want to revisit this decision in the future. */ state[1].dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); - if (state[0].dest->alpha) - fz_clear_pixmap(ctx, state[1].dest); - else - fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); if (state[0].shape) { state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); |