From b9448b06b4b28f03c42c2c3cc4cdb4a4f1016fec Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 23 Nov 2022 18:58:18 +0100 Subject: [PATCH] gsk: Extend the blur radius for outset shadow extents By dividing the blur radius to obtain the clip radius, we may end up with halved values that result in an overshunk clip mask. Extend this so that we ensure to cover the last pixel. Fixes artifacts seen with the cairo renderer in X11 when resizing windows horizontally, a black 1px high line would be seen in the top of the window due to these outset bounds being used in clipping. More mysteriously, also seems to fix resize lag in the GL renderer (also X11), if e.g. the bottom-right corner of a window is resized diagonally in bottom-left -> top-right direction, or bottom-right -> top-left. Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175#note_1599335 --- gsk/gskrendernodeimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 482b14bef9..8eaea1f20a 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -2160,7 +2160,7 @@ gsk_outset_shadow_get_extents (GskOutsetShadowNode *self, { float clip_radius; - clip_radius = gsk_cairo_blur_compute_pixels (self->blur_radius / 2.0); + clip_radius = gsk_cairo_blur_compute_pixels (ceil (self->blur_radius / 2.0)); *top = MAX (0, ceil (clip_radius + self->spread - self->dy)); *right = MAX (0, ceil (clip_radius + self->spread + self->dx)); *bottom = MAX (0, ceil (clip_radius + self->spread + self->dy));