From 5b86cfb4ad256cac40dbe020bc1adaf3a5fa6739 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sat, 22 Nov 2014 17:57:34 +1030 Subject: [PATCH] cairo 1.14 now has high quality downscaling The filter needs to be GOOD or BEST to activate the high quality downscaling. --- poppler/CairoOutputDev.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 4e8abcf..216fae9 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -141,7 +141,11 @@ CairoOutputDev::CairoOutputDev() { strokePathClip = NULL; cairo = NULL; currentFont = NULL; +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0) + prescaleImages = gFalse; +#else prescaleImages = gTrue; +#endif printing = gTrue; use_show_text_glyphs = gFalse; inUncoloredPattern = gFalse; @@ -1801,7 +1805,7 @@ CairoOutputDev::getFilterForSurface(cairo_surface_t *image, GBool interpolate) { if (interpolate) - return CAIRO_FILTER_BILINEAR; + return CAIRO_FILTER_BEST; int orig_width = cairo_image_surface_get_width (image); int orig_height = cairo_image_surface_get_height (image); @@ -1821,7 +1825,7 @@ CairoOutputDev::getFilterForSurface(cairo_surface_t *image, if (scaled_width / orig_width >= 4 || scaled_height / orig_height >= 4) return CAIRO_FILTER_NEAREST; - return CAIRO_FILTER_BILINEAR; + return CAIRO_FILTER_BEST; } void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, -- 2.1.3