From 2471f07356178860cfe5575d2d0606633bb6ebdb Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Tue, 21 Nov 2023 15:20:17 +0100 Subject: [PATCH] LibWeb: Skip painting of empty borders in GPU painter --- .../LibWeb/Painting/PaintingCommandExecutorGPU.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp index 6696c03cb3..edda13e862 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp @@ -263,10 +263,14 @@ CommandResult PaintingCommandExecutorGPU::paint_borders(DevicePixelRect const& b border_rect.height() }; - painter().fill_rect(top_border_rect, borders_data.top.color); - painter().fill_rect(right_border_rect, borders_data.right.color); - painter().fill_rect(bottom_border_rect, borders_data.bottom.color); - painter().fill_rect(left_border_rect, borders_data.left.color); + if (borders_data.top.width > 0) + painter().fill_rect(top_border_rect, borders_data.top.color); + if (borders_data.right.width > 0) + painter().fill_rect(right_border_rect, borders_data.right.color); + if (borders_data.bottom.width > 0) + painter().fill_rect(bottom_border_rect, borders_data.bottom.color); + if (borders_data.left.width > 0) + painter().fill_rect(left_border_rect, borders_data.left.color); return CommandResult::Continue; }