diff options
| author | Alan Third | 2019-06-05 21:51:33 +0100 |
|---|---|---|
| committer | Alan Third | 2019-06-05 22:28:46 +0100 |
| commit | 610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9 (patch) | |
| tree | 8a3ee992ccc310071ac5a97ced8907652974c88e /src/xterm.c | |
| parent | 9201cf62ce9f17793bb6103050c9ba27eb942e57 (diff) | |
| download | emacs-610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9.tar.gz emacs-610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9.zip | |
Add native image rotation and cropping
* lisp/image.el (image--get-imagemagick-and-warn): Only fallback to
ImageMagick if native transforms aren't available.
* src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): New
macros for matrix manipulation.
(HAVE_NATIVE_SCALING, HAVE_NATIVE_TRANSFORMS): Rename and change all
relevant locations.
* src/image.c (x_set_image_rotation):
(x_set_transform): New functions.
(x_set_image_size): Use transform matrix for resizing under X and NS.
(x_set_image_crop): New function.
(lookup_image): Use the new transform functions.
(Fimage_scaling_p, Fimage_transforms_p): Rename and update all
callers.
* src/nsimage.m (ns_load_image): Remove rotation code.
(ns_image_set_transform): New function.
([EmacsImage dealloc]): Release the saved transform.
([EmacsImage rotate:]): Remove unneeded method.
([EmacsImage setTransform:]): New method.
* src/nsterm.h (EmacsImage): Add transform property and update method
definitions.
* src/nsterm.m (ns_dumpglyphs_image): Use the transform to draw the
image correctly.
* src/xterm.c (x_composite_image): Use PictOpSrc as we don't care
about alpha values here.
* doc/lispref/display.texi (Image Descriptors): Add :rotation.
(ImageMagick Images): Remove :rotation.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c index ccc84dcc716..c064647da0c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2883,10 +2883,7 @@ x_composite_image (struct glyph_string *s, Pixmap dest, | |||
| 2883 | destination = XRenderCreatePicture (display, dest, | 2883 | destination = XRenderCreatePicture (display, dest, |
| 2884 | default_format, 0, &attr); | 2884 | default_format, 0, &attr); |
| 2885 | 2885 | ||
| 2886 | /* FIXME: It may make sense to use PictOpSrc instead of | 2886 | XRenderComposite (display, PictOpSrc, |
| 2887 | PictOpOver, as I don't know if we care about alpha values too | ||
| 2888 | much here. */ | ||
| 2889 | XRenderComposite (display, PictOpOver, | ||
| 2890 | s->img->picture, s->img->mask_picture, destination, | 2887 | s->img->picture, s->img->mask_picture, destination, |
| 2891 | srcX, srcY, | 2888 | srcX, srcY, |
| 2892 | srcX, srcY, | 2889 | srcX, srcY, |