From bbf490bacf488f1e332ed0f5d5568af489aaa3c8 Mon Sep 17 00:00:00 2001 From: Russell Haley Date: Sat, 13 Feb 2016 18:59:17 -0600 Subject: EomScrollView: Use better downscaling filter Replace all instances of CAIRO_FILTER_BILINEAR with CAIRO_FILTER_GOOD. This produces much less aliasing on downscaled images. CAIRO_FILTER_GOOD uses the same method as CAIRO_FILTER_BILINEAR for scale factors greater than 0.75, according to https://bugs.webkit.org/show_bug.cgi?id=147826. Comparison screenshots made with eog 3.18.1: http://imgur.com/a/NaoOs CAIRO_FILTER_BEST is better still, but the the visual difference is almost imperceptible and the performance impact is severe. https://bugzilla.gnome.org/show_bug.cgi?id=665897 origin commit: https://gitlab.gnome.org/GNOME/eog/commit/fbc1128 fixes https://github.com/mate-desktop/eom/issues/96 --- src/eom-scroll-view.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c index 5f424b6..491796c 100644 --- a/src/eom-scroll-view.c +++ b/src/eom-scroll-view.c @@ -1410,7 +1410,7 @@ eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state) priv = view->priv; - new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST; + new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST; if (priv->interp_type_in != new_interp_type) { priv->interp_type_in = new_interp_type; @@ -1429,7 +1429,7 @@ eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state) priv = view->priv; - new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST; + new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST; if (priv->interp_type_out != new_interp_type) { priv->interp_type_out = new_interp_type; @@ -1737,8 +1737,8 @@ eom_scroll_view_init (EomScrollView *view) priv->min_zoom = MIN_ZOOM_FACTOR; priv->zoom_mode = ZOOM_MODE_FIT; priv->upscale = FALSE; - priv->interp_type_in = CAIRO_FILTER_BILINEAR; - priv->interp_type_out = CAIRO_FILTER_BILINEAR; + priv->interp_type_in = CAIRO_FILTER_GOOD; + priv->interp_type_out = CAIRO_FILTER_GOOD; priv->scroll_wheel_zoom = FALSE; priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER; priv->image = NULL; -- cgit v1.2.1