1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:27:45 +00:00

LibWeb/Painting: Do not paint box outer shadows not visible in viewport

This change separates the box outer shadow metrics calculations into a
separate function. This function is then used to obtain the shadow
bounding rectangle and skip painting if the entire shadow is outside
of the viewport.
This commit is contained in:
Aliaksandr Kalenik 2023-10-19 01:16:01 +02:00 committed by Andreas Kling
parent 596bc76b7a
commit 99217bf6db
3 changed files with 192 additions and 40 deletions

View file

@ -14,9 +14,11 @@
namespace Web::Painting {
void paint_outer_box_shadow(Gfx::Painter&, PaintOuterBoxShadowParams params);
void paint_inner_box_shadow(Gfx::Painter&, PaintOuterBoxShadowParams params);
Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintOuterBoxShadowParams params);
void paint_outer_box_shadow(Gfx::Painter& painter, PaintOuterBoxShadowParams params);
void paint_box_shadow(
PaintContext&,
CSSPixelRect const& bordered_content_rect,