[poppler] poppler/CairoOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Sep 24 11:23:44 UTC 2017


 poppler/CairoOutputDev.cc |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a1a4be92323ae45f1ecc16595438520309554eb0
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 24 13:21:58 2017 +0200

    cairo: do not use the custom downscaling for rendering images when using cairo >= 1.14

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 4d3cf02d..5a644f0a 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -3077,7 +3077,13 @@ public:
       }
     }
 
-    if (printing || scaledWidth >= width || scaledHeight >= height) {
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
+    bool needsCustomDownscaling = false;
+#else
+    bool needsCustomDownscaling = true;
+#endif
+
+    if (!needsCustomDownscaling || printing || scaledWidth >= width || scaledHeight >= height) {
       // No downscaling. Create cairo image containing the source image data.
       unsigned char *buffer;
       int stride;
@@ -3191,7 +3197,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
   cairo_matrix_t matrix;
   int width, height;
   int scaledWidth, scaledHeight;
-  cairo_filter_t filter = CAIRO_FILTER_BILINEAR;
+  cairo_filter_t filter = CAIRO_FILTER_BEST;
   RescaleDrawImage rescale;
 
   LOG (printf ("drawImage %dx%d\n", widthA, heightA));


More information about the poppler mailing list