poppler/CairoOutputDev.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit c59d93061cf71d13916872a20aed37ecfbb3bfa4 Author: Carlos Garcia Campos <carlo...@gnome.org> Date: Mon Nov 9 18:32:55 2009 +0100 [cairo] Do nothing when image mask is 1x1 and the pixel is 0 diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index ec9aaa5..5f283c3 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1328,6 +1328,20 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, /* work around a cairo bug when scaling 1x1 surfaces */ if (width == 1 && height == 1) { + ImageStream *imgStr; + Guchar pix; + int invert_bit; + + imgStr = new ImageStream(str, width, 1, 1); + imgStr->reset(); + imgStr->getPixel(&pix); + imgStr->close(); + delete imgStr; + + invert_bit = invert ? 1 : 0; + if (pix ^ invert_bit) + return; + cairo_save (cairo); cairo_rectangle (cairo, 0., 0., width, height); cairo_fill (cairo); _______________________________________________ poppler mailing list poppler@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/poppler