LibWeb: Don't clip descendants outside stacking context root rect

Skia allows you to pass a bounding rect to its saveLayer() function as
an optimization when you know that you won't paint outside those bounds.
Unfortunately, we were passing a too-small rectangle that didn't take
into account transformed descendants, etc.

For now, simply pass null instead of a bounding rect. This way, Skia
figures it out internally. It may allocate larger temporary bitmaps than
needed this way, but at least we get more correct results. I've left
re-enabling the optimization as a FIXME in the code.

This fixes unwanted clipping in various parts of the Discord UI.
This commit is contained in:
Andreas Kling 2025-07-24 12:36:47 +02:00 committed by Alexander Kalenik
commit b4435bd50c
Notes: github-actions[bot] 2025-07-24 15:17:25 +00:00
7 changed files with 29 additions and 11 deletions

View file

@ -324,7 +324,6 @@ void StackingContext::paint(PaintContext& context) const
.compositing_and_blending_operator = compositing_and_blending_operator,
.isolate = paintable_box().computed_values().isolation() == CSS::Isolation::Isolate,
.is_fixed_position = paintable_box().is_fixed_position(),
.source_paintable_rect = source_paintable_rect,
.transform = {
.origin = transform_origin.scaled(to_device_pixels_scale),
.matrix = matrix_with_scaled_translation(transform_matrix, to_device_pixels_scale),