aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorEli Zaretskii2019-01-20 17:59:12 +0200
committerEli Zaretskii2019-01-20 17:59:12 +0200
commit67b1053dcd958d21a964dc09c2ba9666e11240b2 (patch)
tree1eb1272130b47d1fa76f095b300a28df7e808a0f /src/image.c
parent551051596fe51d6e232315eeda8a0a79eb43bfdf (diff)
downloademacs-67b1053dcd958d21a964dc09c2ba9666e11240b2.tar.gz
emacs-67b1053dcd958d21a964dc09c2ba9666e11240b2.zip
Support native image resizing on MS-Windows
* src/w32term.c (x_draw_image_foreground): Scale the image if the requested dimensions are different from the bitmap dimensions. * src/image.c (Fimage_scaling_p): Return t when HAVE_NTGUI. (x_set_image_size) [HAVE_NTGUI]: Record the scaled dimensions in the image struct. * src/dispextern.h (HAVE_NATIVE_SCALING): Define when HAVE_NTGUI as well. * etc/NEWS: Update the announcement of native image scaling.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index bcc61dfccda..20148605817 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1900,6 +1900,12 @@ x_set_image_size (struct frame *f, struct image *img)
1900 img->height = height; 1900 img->height = height;
1901 } 1901 }
1902# endif 1902# endif
1903# ifdef HAVE_NTGUI
1904 /* Under HAVE_NTGUI, we will scale the image on the fly, when we
1905 draw it. See w32term.c:x_draw_image_foreground. */
1906 img->width = width;
1907 img->height = height;
1908# endif
1903#endif 1909#endif
1904} 1910}
1905 1911
@@ -9915,7 +9921,7 @@ DEFUN ("image-scaling-p", Fimage_scaling_p, Simage_scaling_p, 0, 1, 0,
9915Return t if FRAME supports native scaling, nil otherwise. */) 9921Return t if FRAME supports native scaling, nil otherwise. */)
9916 (Lisp_Object frame) 9922 (Lisp_Object frame)
9917{ 9923{
9918#ifdef HAVE_NS 9924#if defined (HAVE_NS) || defined (HAVE_NTGUI)
9919 return Qt; 9925 return Qt;
9920#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) 9926#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
9921 int event_basep, error_basep; 9927 int event_basep, error_basep;