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
This commit is contained in:
Carlos Garnacho 2022-11-23 18:58:18 +01:00
parent 35744d87a2
commit b9448b06b4

View File

@ -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));