summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-01-20 17:59:12 +0200
committerEli Zaretskii <eliz@gnu.org>2019-01-20 17:59:12 +0200
commit67b1053dcd958d21a964dc09c2ba9666e11240b2 (patch)
tree1eb1272130b47d1fa76f095b300a28df7e808a0f /src/image.c
parent551051596fe51d6e232315eeda8a0a79eb43bfdf (diff)
downloademacs-67b1053dcd958d21a964dc09c2ba9666e11240b2.tar.gz
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)
img->height = height;
}
# endif
+# ifdef HAVE_NTGUI
+ /* Under HAVE_NTGUI, we will scale the image on the fly, when we
+ draw it. See w32term.c:x_draw_image_foreground. */
+ img->width = width;
+ img->height = height;
+# endif
#endif
}
@@ -9915,7 +9921,7 @@ DEFUN ("image-scaling-p", Fimage_scaling_p, Simage_scaling_p, 0, 1, 0,
Return t if FRAME supports native scaling, nil otherwise. */)
(Lisp_Object frame)
{
-#ifdef HAVE_NS
+#if defined (HAVE_NS) || defined (HAVE_NTGUI)
return Qt;
#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
int event_basep, error_basep;