From: Carlos Garnacho Date: Wed, 23 Nov 2022 17:58:18 +0000 (+0100) Subject: gsk: Extend the blur radius for outset shadow extents X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~77^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b9448b06b4b28f03c42c2c3cc4cdb4a4f1016fec;p=gtk4.git 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 --- 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));