summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-06-08 13:05:15 +0900
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-06-08 13:05:15 +0900
commit88c49ac31898e7b2c29338ca55cae292c450f7be (patch)
tree6130d1732acceaf2eef70327acb724c14171934d /src/gtkutil.c
parent890a0826f3f68f4476f6ec0b56fe96c6bc047142 (diff)
downloademacs-88c49ac31898e7b2c29338ca55cae292c450f7be.tar.gz
Implement native image rotation and cropping on cairo
* src/dispextern.h (struct image) [USE_CAIRO]: * src/image.c (free_image, image_clear_image_1) (image_set_crop, image_set_size, image_set_rotation) (image_create_x_image_and_pixmap) [USE_CAIRO]: #ifdef out HAVE_XRENDER part. * src/image.c (cr_create_surface_from_pix_containers) [USE_CAIRO]: Rename from cr_create_surface_from_pix_containers. Change arguments to pair of Emacs_Pix_Container:s. Move block_input and unblock_input to caller. (cr_put_image_to_cr_data) [USE_CAIRO]: New function. (prepare_image_for_display) [USE_CAIRO]: Use it. (image_set_transform) [USE_CAIRO]: Create dummy solid color pattern equipped with transformation matrix and set it to img->cr_data. * src/xterm.c (fringe_bmp) [USE_CAIRO]: Change type to cairo_pattern_t **. (x_cr_define_fringe_bitmap, x_cr_destroy_fringe_bitmap) [USE_CAIRO]: Create or destroy cairo pattern. (x_cr_draw_image) [USE_CAIRO]: Remove arguments image_width and image_height. Change type of image to cairo pattern. All callers changed. * src/gtkutil.c (xg_get_image_for_pixmap) [USE_CAIRO]: Get cairo surface from img->cr_data, which is of cairo pattern now.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 59e4328a6fc..dccee159254 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -394,7 +394,10 @@ xg_get_image_for_pixmap (struct frame *f,
certain themes. */
#ifdef USE_CAIRO
- surface = img->cr_data;
+ if (cairo_pattern_get_type (img->cr_data) == CAIRO_PATTERN_TYPE_SURFACE)
+ cairo_pattern_get_surface (img->cr_data, &surface);
+ else
+ surface = NULL;
if (surface)
{