summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-24 12:44:55 +0800
committerPo Lu <luangruo@yahoo.com>2022-01-24 12:44:55 +0800
commit45208755d13f23f92edcab4d6959e0fd9423843b (patch)
tree95bdca80a788eeedd491e2ae54941ba2af3a7644 /src/image.c
parent3a7b158ffd8d468eb92de1de6418b3831f10142b (diff)
downloademacs-45208755d13f23f92edcab4d6959e0fd9423843b.tar.gz
Add some code for transparent frame backgrounds without Cairo
* src/image.c (svg_load_image): Fix build without native image transforms. * src/xfns.c (set_up_x_back_buffer): (tear_down_x_back_buffer): Free XR picture if present. * src/xftfont.c (xftfont_get_xft_draw): Fix formatting issue. * src/xterm.c (x_xr_ensure_picture): New function. (FRAME_CR_CONTEXT, FRAME_CR_CONTEXT): (FRAME_CR_SURFACE_DESIRED_WIDTH) (FRAME_CR_SURFACE_DESIRED_HEIGHT): Move to separate USE_CAIRO block so the ext data code can be used on builds with XRender as well. (x_xr_apply_ext_clip): (x_xr_reset_ext_clip): New functions. (x_set_clip_rectangles): (x_reset_clip_rectangles): Set ext data on XRender as well. (x_term_init): Look for a picture format appropriate for our purposes. (x_clear_area): Use XRenderFillRectangle to draw backgrounds if available. (x_xrender_color_from_gc_foreground): (x_xrender_color_from_gc_background): New functions. * src/xterm.h (FRAME_X_PICTURE): (FRAME_X_PICTURE_FORMAT) (FRAME_CHECK_XR_VERSION): New macros. (struct x_gc_ext_data): Define on XRender as well. (struct x_display_info): Define ext_codes when using XRender and add new field `pict_format'. (struct x_output): New field `picture'.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c
index 7ee595297fa..951531505e6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -10672,11 +10672,16 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
viewbox_height = dimension_data.height;
#endif
+#ifdef HAVE_NATIVE_TRANSFORMS
compute_image_size (viewbox_width, viewbox_height, img,
&width, &height);
width = scale_image_size (width, 1, FRAME_SCALE_FACTOR (f));
height = scale_image_size (height, 1, FRAME_SCALE_FACTOR (f));
+#else
+ width = viewbox_width;
+ height = viewbox_height;
+#endif
if (! check_image_size (f, width, height))
{