From f32764975a58fbbce91a9b4b8386c8c585986ce1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 21 Oct 2023 16:46:59 +0200 Subject: [PATCH] LibWeb: Remove ClearRect command in RecordingPainter There is only one usage of ClearRect command and it could be replaced with FillRect to make set of commands in RecordingPainter smaller. --- .../LibWeb/Painting/RecordingPainter.cpp | 17 ----------------- .../LibWeb/Painting/RecordingPainter.h | 9 --------- Userland/Services/WebContent/PageHost.cpp | 2 +- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp index 08207007f8..e0f6b56cfc 100644 --- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp +++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp @@ -31,15 +31,6 @@ struct CommandExecutionState { Vector stacking_contexts; }; -CommandResult ClearRect::execute(CommandExecutionState& state) const -{ - if (state.would_be_fully_clipped_by_painter(rect)) - return CommandResult::Continue; - - state.painter().clear_rect(rect, color); - return CommandResult::Continue; -} - CommandResult FillRectWithRoundedCorners::execute(CommandExecutionState& state) const { if (state.would_be_fully_clipped_by_painter(rect)) @@ -506,14 +497,6 @@ void RecordingPainter::blit_corner_clipping(NonnullRefPtrpaintable())