From 0e85762ec5272dff1d3a0ccb64c6ff59b945410b Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 14 Nov 2012 23:50:10 +1030 Subject: [PATCH] cairo: fix soft mask when image resolution != smask resolution Both image and mask are drawn the same size (unit square) regardless of the size of the image data. Bug 57070 --- poppler/CairoOutputDev.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index f4c4ada..86140b7 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -2624,9 +2624,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_set_source (cairo, pattern); if (!printing) { - cairo_rectangle (cairo, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo, 0., 0., 1., 1.); cairo_clip (cairo); } cairo_mask (cairo, maskPattern); @@ -2635,9 +2633,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_pop_group_to_source (cairo); cairo_save (cairo); if (!printing) { - cairo_rectangle (cairo, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo, 0., 0., 1., 1.); cairo_clip (cairo); } cairo_paint_with_alpha (cairo, fill_opacity); @@ -2648,9 +2644,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_save (cairo_shape); cairo_set_source (cairo_shape, pattern); if (!printing) { - cairo_rectangle (cairo_shape, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo_shape, 0., 0., 1., 1.); cairo_fill (cairo_shape); } else { cairo_mask (cairo_shape, pattern); -- 1.7.10.4