aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2019-03-27 11:04:46 +0900
committerYAMAMOTO Mitsuharu2019-03-27 11:12:18 +0900
commit2755cf1848b551436b9cc2eff6e4b882b10c07aa (patch)
tree0c496f95796f8417f69b5221412162763d1ef4bb /src/image.c
parentd7e442651777805958bd6bcbc8312a6cce147e4a (diff)
downloademacs-2755cf1848b551436b9cc2eff6e4b882b10c07aa.tar.gz
emacs-2755cf1848b551436b9cc2eff6e4b882b10c07aa.zip
Support native image resizing on cairo
* src/xterm.c (x_cr_draw_image): Add arguments image_width and image_height and support scaling. All callers changed. * src/image.c (Fimage_scaling_p): Return t when USE_CAIRO. (x_set_image_size) [USE_CAIRO]: Record the scaled dimensions in the image struct. * src/dispextern.h (HAVE_NATIVE_SCALING): Define when USE_CAIRO as well. * etc/NEWS: Update the announcement of native image scaling.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index 16c5978db6e..6e415ef1f70 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1878,7 +1878,10 @@ x_set_image_size (struct frame *f, struct image *img)
1878 img->height = height; 1878 img->height = height;
1879# endif 1879# endif
1880 1880
1881# ifdef HAVE_XRENDER 1881# ifdef USE_CAIRO
1882 img->width = width;
1883 img->height = height;
1884# elif defined HAVE_XRENDER
1882 if (img->picture) 1885 if (img->picture)
1883 { 1886 {
1884 double xscale = img->width / (double) width; 1887 double xscale = img->width / (double) width;
@@ -9918,7 +9921,7 @@ DEFUN ("image-scaling-p", Fimage_scaling_p, Simage_scaling_p, 0, 1, 0,
9918Return t if FRAME supports native scaling, nil otherwise. */) 9921Return t if FRAME supports native scaling, nil otherwise. */)
9919 (Lisp_Object frame) 9922 (Lisp_Object frame)
9920{ 9923{
9921#if defined (HAVE_NS) || defined (HAVE_NTGUI) 9924#if defined (USE_CAIRO) || defined (HAVE_NS) || defined (HAVE_NTGUI)
9922 return Qt; 9925 return Qt;
9923#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) 9926#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
9924 int event_basep, error_basep; 9927 int event_basep, error_basep;