Skip to content

Commit bbf490b

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 433c776 commit bbf490b

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
@@ -1410,7 +1410,7 @@ eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state)
14101410

14111411
priv = view->priv;
14121412

1413-
new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
1413+
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
14141414

14151415
if (priv->interp_type_in != new_interp_type) {
14161416
priv->interp_type_in = new_interp_type;
@@ -1429,7 +1429,7 @@ eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state)
14291429

14301430
priv = view->priv;
14311431

1432-
new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
1432+
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
14331433

14341434
if (priv->interp_type_out != new_interp_type) {
14351435
priv->interp_type_out = new_interp_type;
@@ -1737,8 +1737,8 @@ eom_scroll_view_init (EomScrollView *view)
17371737
priv->min_zoom = MIN_ZOOM_FACTOR;
17381738
priv->zoom_mode = ZOOM_MODE_FIT;
17391739
priv->upscale = FALSE;
1740-
priv->interp_type_in = CAIRO_FILTER_BILINEAR;
1741-
priv->interp_type_out = CAIRO_FILTER_BILINEAR;
1740+
priv->interp_type_in = CAIRO_FILTER_GOOD;
1741+
priv->interp_type_out = CAIRO_FILTER_GOOD;
17421742
priv->scroll_wheel_zoom = FALSE;
17431743
priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER;
17441744
priv->image = NULL;

0 commit comments

Comments
 (0)