LibWeb: Implement rejection by bounding box for PaintInnerBoxShadow

Before this change we were painting inner shadows lying outside of
viewport.

Improves painting performance on Github and Twitter where this command
is used a lot.
This commit is contained in:
Aliaksandr Kalenik 2024-06-07 18:10:29 +03:00 committed by Andreas Kling
parent 1c8d37d528
commit 9be5867eb2
Notes: sideshowbarker 2024-07-16 23:03:06 +09:00
2 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,11 @@ Gfx::IntRect PaintOuterBoxShadow::bounding_rect() const
return get_outer_box_shadow_bounding_rect(box_shadow_params);
}
Gfx::IntRect PaintInnerBoxShadow::bounding_rect() const
{
return box_shadow_params.device_content_rect;
}
void PaintOuterBoxShadow::translate_by(Gfx::IntPoint const& offset)
{
box_shadow_params.device_content_rect.translate_by(offset);

View file

@ -149,6 +149,7 @@ struct PaintOuterBoxShadow {
struct PaintInnerBoxShadow {
PaintBoxShadowParams box_shadow_params;
[[nodiscard]] Gfx::IntRect bounding_rect() const;
void translate_by(Gfx::IntPoint const& offset);
};