[poppler] poppler/CairoOutputDev.cc
Adrian Johnson
ajohnson at kemper.freedesktop.org
Wed Jan 11 06:49:18 PST 2012
poppler/CairoOutputDev.cc | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
New commits:
commit 9b8b4232587831fdada37de033c272a3c5049c34
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Thu Jan 12 00:26:03 2012 +1030
cairo: avoid setting huge clip area when printing
Bug 44002
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index fae0136..e2ecfda 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -2779,15 +2779,17 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
cairo_save (cairo);
cairo_set_source (cairo, pattern);
- if (printing)
- cairo_rectangle (cairo, 0., 0., width, height);
- else
+ if (!printing)
cairo_rectangle (cairo, 0., 0., 1., 1.);
if (maskPattern) {
- cairo_clip (cairo);
+ if (!printing)
+ cairo_clip (cairo);
cairo_mask (cairo, maskPattern);
} else {
- cairo_fill (cairo);
+ if (printing)
+ cairo_paint (cairo);
+ else
+ cairo_fill (cairo);
}
cairo_restore (cairo);
@@ -2796,11 +2798,12 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
if (cairo_shape) {
cairo_save (cairo_shape);
cairo_set_source (cairo_shape, pattern);
- if (printing)
- cairo_rectangle (cairo_shape, 0., 0., width, height);
- else
+ if (printing) {
+ cairo_paint (cairo_shape);
+ } else {
cairo_rectangle (cairo_shape, 0., 0., 1., 1.);
- cairo_fill (cairo_shape);
+ cairo_fill (cairo_shape);
+ }
cairo_restore (cairo_shape);
}
More information about the poppler
mailing list