summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-03-27 11:04:46 +0900
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-03-27 11:12:18 +0900
commit2755cf1848b551436b9cc2eff6e4b882b10c07aa (patch)
tree0c496f95796f8417f69b5221412162763d1ef4bb /src/image.c
parentd7e442651777805958bd6bcbc8312a6cce147e4a (diff)
downloademacs-2755cf1848b551436b9cc2eff6e4b882b10c07aa.tar.gz
emacs-2755cf1848b551436b9cc2eff6e4b882b10c07aa.tar.bz2
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)
img->height = height;
# endif
-# ifdef HAVE_XRENDER
+# ifdef USE_CAIRO
+ img->width = width;
+ img->height = height;
+# elif defined HAVE_XRENDER
if (img->picture)
{
double xscale = img->width / (double) width;
@@ -9918,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)
{
-#if defined (HAVE_NS) || defined (HAVE_NTGUI)
+#if defined (USE_CAIRO) || defined (HAVE_NS) || defined (HAVE_NTGUI)
return Qt;
#elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
int event_basep, error_basep;