mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-26 19:28:59 +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:
parent
596bc76b7a
commit
99217bf6db
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 99217bf6db
Pull-request: https://github.com/SerenityOS/serenity/pull/21487
3 changed files with 192 additions and 40 deletions
|
@ -328,6 +328,9 @@ CommandResult PaintConicGradient::execute(CommandExecutionState& state) const
|
|||
|
||||
CommandResult PaintOuterBoxShadow::execute(CommandExecutionState& state) const
|
||||
{
|
||||
auto bounding_rect = get_outer_box_shadow_bounding_rect(outer_box_shadow_params);
|
||||
if (state.would_be_fully_clipped_by_painter(bounding_rect))
|
||||
return CommandResult::Continue;
|
||||
auto& painter = state.painter();
|
||||
paint_outer_box_shadow(painter, outer_box_shadow_params);
|
||||
return CommandResult::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue