1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

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.
This commit is contained in:
Aliaksandr Kalenik 2023-10-21 16:46:59 +02:00 committed by Andreas Kling
parent 8922574133
commit f32764975a
3 changed files with 1 additions and 27 deletions

View file

@ -31,15 +31,6 @@ struct CommandExecutionState {
Vector<StackingContext> 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(NonnullRefPtr<BorderRadiusCornerClip
push_command(BlitCornerClipping { corner_clipper });
}
void RecordingPainter::clear_rect(Gfx::IntRect const& rect, Color color)
{
push_command(ClearRect {
.rect = rect,
.color = color,
});
}
void RecordingPainter::fill_rect(Gfx::IntRect const& rect, Color color)
{
push_command(FillRect {