mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 10:18:59 +00:00
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:
parent
1c8d37d528
commit
9be5867eb2
Notes:
sideshowbarker
2024-07-16 23:03:06 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 9be5867eb2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/98
2 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,11 @@ Gfx::IntRect PaintOuterBoxShadow::bounding_rect() const
|
||||||
return get_outer_box_shadow_bounding_rect(box_shadow_params);
|
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)
|
void PaintOuterBoxShadow::translate_by(Gfx::IntPoint const& offset)
|
||||||
{
|
{
|
||||||
box_shadow_params.device_content_rect.translate_by(offset);
|
box_shadow_params.device_content_rect.translate_by(offset);
|
||||||
|
|
|
@ -149,6 +149,7 @@ struct PaintOuterBoxShadow {
|
||||||
struct PaintInnerBoxShadow {
|
struct PaintInnerBoxShadow {
|
||||||
PaintBoxShadowParams box_shadow_params;
|
PaintBoxShadowParams box_shadow_params;
|
||||||
|
|
||||||
|
[[nodiscard]] Gfx::IntRect bounding_rect() const;
|
||||||
void translate_by(Gfx::IntPoint const& offset);
|
void translate_by(Gfx::IntPoint const& offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue