Skip to content

Commit 7f38bf6

Browse files
yumpraveit65
authored andcommitted
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 #96
1 parent f607cda commit 7f38bf6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/eom-scroll-view.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state)
14111411

14121412
priv = view->priv;
14131413

1414-
new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
1414+
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
14151415

14161416
if (priv->interp_type_in != new_interp_type) {
14171417
priv->interp_type_in = new_interp_type;
@@ -1430,7 +1430,7 @@ eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state)
14301430

14311431
priv = view->priv;
14321432

1433-
new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
1433+
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
14341434

14351435
if (priv->interp_type_out != new_interp_type) {
14361436
priv->interp_type_out = new_interp_type;
@@ -1763,8 +1763,8 @@ eom_scroll_view_init (EomScrollView *view)
17631763
priv->min_zoom = MIN_ZOOM_FACTOR;
17641764
priv->zoom_mode = ZOOM_MODE_FIT;
17651765
priv->upscale = FALSE;
1766-
priv->interp_type_in = CAIRO_FILTER_BILINEAR;
1767-
priv->interp_type_out = CAIRO_FILTER_BILINEAR;
1766+
priv->interp_type_in = CAIRO_FILTER_GOOD;
1767+
priv->interp_type_out = CAIRO_FILTER_GOOD;
17681768
priv->scroll_wheel_zoom = FALSE;
17691769
priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER;
17701770
priv->image = NULL;

0 commit comments

Comments
 (0)