mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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: https://github.com/LadybirdBrowser/ladybird/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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue