1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-12-02 14:15:41 -05:00

backend/xrender: fix rounded corner mask for blur

The coordinate conversions were a little bit wrong.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-10-12 23:17:40 +01:00
parent 729ea6575a
commit 3b117e217a
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -242,9 +242,8 @@ xrender_process_mask(struct xrender_data *xd, const struct backend_mask_image *m
(xcb_render_create_picture_value_list_t[]){XCB_RENDER_REPEAT_NONE});
xrender_set_picture_repeat(xd, inner->pict, XCB_RENDER_REPEAT_NONE);
xcb_render_composite(xd->base.c->c, XCB_RENDER_PICT_OP_SRC, inner->pict, XCB_NONE,
ret, to_i16_checked(extent.x1 - mask->origin.x),
to_i16_checked(extent.y1 - mask->origin.y), 0, 0, 0, 0,
w_u16, h_u16);
ret, to_i16_checked(extent.x1), to_i16_checked(extent.y1), 0,
0, 0, 0, w_u16, h_u16);
if (mask->corner_radius != 0) {
if (inner->rounded_rectangle != NULL &&
inner->rounded_rectangle->radius != (int)mask->corner_radius) {
@ -569,8 +568,8 @@ static bool xrender_blur(struct backend_base *base, ivec2 origin,
if (args->source_mask != NULL) {
// Translate the target mask region to the mask's coordinate
auto mask_extent = *pixman_region32_extents(args->target_mask);
region_translate_rect(
mask_extent, ivec2_neg(ivec2_add(origin, args->source_mask->origin)));
mask_extent =
region_translate_rect(mask_extent, ivec2_neg(args->source_mask->origin));
mask_pict_origin = args->source_mask->origin;
mask_pict = xrender_process_mask(xd, args->source_mask, mask_extent,
args->opacity != 1.0 ? mask_pict : XCB_NONE,