GNU bug report logs -
#38394
Fwd: Use different image filtering when zooming in vs zooming out
Previous Next
Reported by: Alan Third <alan <at> idiocy.org>
Date: Tue, 26 Nov 2019 21:42:02 UTC
Severity: normal
Merged with 39736
Found in version 27.0.60
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
Full log
Message #31 received at 38394 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Mon, 3 Aug 2020 10:10:06 +0100, Alan Third <alan <at> idiocy.org> said:
Alan> diff --git a/src/image.c b/src/image.c
Alan> index e7e0a93313..a6b24e6652 100644
Alan> --- a/src/image.c
Alan> +++ b/src/image.c
Alan> @@ -259,6 +259,8 @@ cr_put_image_to_cr_data (struct image *img)
Alan> cairo_matrix_t matrix;
Alan> cairo_pattern_get_matrix (img->cr_data, &matrix);
Alan> cairo_pattern_set_matrix (pattern, &matrix);
Alan> + cairo_pattern_set_filter
Alan> + (pattern, cairo_pattern_get_filter (img->cr_data));
Alan> cairo_pattern_destroy (img->cr_data);
Alan> }
Alan> cairo_surface_destroy (surface);
Alan> @@ -2114,6 +2116,15 @@ image_set_transform (struct frame *f, struct image *img)
Alan> double rotation = 0.0;
Alan> compute_image_rotation (img, &rotation);
Alan> +# if defined HAVE_XRENDER
Alan> + /* We want scale up operations to use a nearest neighbour filter to
Alan> + show real pixels instead of munging them, but scale down
Alan> + operations to use a blended filter, to avoid aliasing and the like.
Alan> +
Alan> + TODO: implement for NS and Windows. */
Alan> + bool scale_down = (width < img->width) || (height < img->height);
Alan> +# endif
Alan> +
Alan> /* Perform scale transformation. */
Alan> matrix3x3 matrix
Alan> @@ -2230,6 +2241,8 @@ image_set_transform (struct frame *f, struct image *img)
Alan> matrix[1][1], matrix[2][0], matrix[2][1]};
Alan> cairo_pattern_t *pattern = cairo_pattern_create_rgb (0, 0, 0);
Alan> cairo_pattern_set_matrix (pattern, &cr_matrix);
Alan> + cairo_pattern_set_filter (pattern, scale_down
IsnĘžt scale_down only defined if HAVE_XRENDER? This usage is under
USE_CAIRO
This bug report was last modified 4 years and 339 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.