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

LibWeb/Painting: Do not clip border radius when it is out of viewport

Painting optimization to do less unnecessary work.
This commit is contained in:
Aliaksandr Kalenik 2023-10-18 16:24:20 +02:00 committed by Andreas Kling
parent b835d2bd66
commit 708574d373
3 changed files with 10 additions and 2 deletions

View file

@ -482,6 +482,8 @@ CommandResult DrawTriangleWave::execute(CommandExecutionState& state) const
CommandResult SampleUnderCorners::execute(CommandExecutionState& state) const
{
if (state.would_be_fully_clipped_by_painter(corner_clipper->border_rect().to_type<int>()))
return CommandResult::Continue;
auto& painter = state.painter();
corner_clipper->sample_under_corners(painter);
return CommandResult::Continue;
@ -489,6 +491,8 @@ CommandResult SampleUnderCorners::execute(CommandExecutionState& state) const
CommandResult BlitCornerClipping::execute(CommandExecutionState& state) const
{
if (state.would_be_fully_clipped_by_painter(corner_clipper->border_rect().to_type<int>()))
return CommandResult::Continue;
auto& painter = state.painter();
corner_clipper->blit_corner_clipping(painter);
return CommandResult::Continue;