mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
LibWeb: Skip empty paint borders commands in RecordingPainter
With this change, we create substantially fewer border painting commands, which means fewer reallocations of the vector that stores commands. This makes the rendering of https://html.spec.whatwg.org/multipage/browsing-the-web.html visibly faster, where we allocated ~10 of such commands now vs ~8000 before.
This commit is contained in:
parent
f7a1f28d7f
commit
c7e22c7a72
1 changed files with 2 additions and 0 deletions
|
@ -411,6 +411,8 @@ void RecordingPainter::draw_triangle_wave(Gfx::IntPoint a_p1, Gfx::IntPoint a_p2
|
|||
|
||||
void RecordingPainter::paint_borders(DevicePixelRect const& border_rect, CornerRadii const& corner_radii, BordersDataDevicePixels const& borders_data)
|
||||
{
|
||||
if (borders_data.top.width == 0 && borders_data.right.width == 0 && borders_data.bottom.width == 0 && borders_data.left.width == 0)
|
||||
return;
|
||||
push_command(PaintBorders { border_rect, corner_radii, borders_data });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue