LibWeb: Remove unused blend mode param in FillEllipse painting command

This commit is contained in:
Aliaksandr Kalenik 2024-04-20 10:20:01 +02:00 committed by Alexander Kalenik
commit cedf6dd2c3
Notes: sideshowbarker 2024-07-17 01:55:29 +09:00
9 changed files with 9 additions and 11 deletions

View file

@ -261,7 +261,6 @@ struct DrawEllipse {
struct FillEllipse {
Gfx::IntRect rect;
Color color;
Gfx::AntiAliasingPainter::BlendMode blend_mode;
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }

View file

@ -354,10 +354,10 @@ CommandResult CommandExecutorCPU::draw_ellipse(Gfx::IntRect const& rect, Color c
return CommandResult::Continue;
}
CommandResult CommandExecutorCPU::fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode blend_mode)
CommandResult CommandExecutorCPU::fill_ellipse(Gfx::IntRect const& rect, Color const& color)
{
Gfx::AntiAliasingPainter aa_painter(painter());
aa_painter.fill_ellipse(rect, color, blend_mode);
aa_painter.fill_ellipse(rect, color);
return CommandResult::Continue;
}

View file

@ -32,7 +32,7 @@ public:
CommandResult stroke_path_using_color(Gfx::Path const&, Color const& color, float thickness, Gfx::FloatPoint const& aa_translation) override;
CommandResult stroke_path_using_paint_style(Gfx::Path const& path, Gfx::PaintStyle const& paint_style, float thickness, float opacity, Gfx::FloatPoint const& aa_translation) override;
CommandResult draw_ellipse(Gfx::IntRect const& rect, Color const& color, int thickness) override;
CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode blend_mode) override;
CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color) override;
CommandResult draw_line(Color const&, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle style, Color const& alternate_color) override;
CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const& sdf, float smoothing) override;
CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) override;

View file

@ -246,7 +246,7 @@ CommandResult CommandExecutorGPU::draw_ellipse(Gfx::IntRect const&, Color const&
return CommandResult::Continue;
}
CommandResult CommandExecutorGPU::fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode)
CommandResult CommandExecutorGPU::fill_ellipse(Gfx::IntRect const& rect, Color const& color)
{
auto horizontal_radius = static_cast<float>(rect.width() / 2);
auto vertical_radius = static_cast<float>(rect.height() / 2);

View file

@ -33,7 +33,7 @@ public:
CommandResult stroke_path_using_color(Gfx::Path const&, Color const& color, float thickness, Gfx::FloatPoint const& aa_translation) override;
CommandResult stroke_path_using_paint_style(Gfx::Path const& path, Gfx::PaintStyle const& paint_style, float thickness, float opacity, Gfx::FloatPoint const& aa_translation) override;
CommandResult draw_ellipse(Gfx::IntRect const& rect, Color const& color, int thickness) override;
CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode blend_mode) override;
CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color) override;
CommandResult draw_line(Color const&, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle style, Color const& alternate_color) override;
CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const& sdf, float smoothing) override;
CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) override;

View file

@ -173,7 +173,7 @@ void CommandList::execute(CommandExecutor& executor)
return executor.draw_ellipse(command.rect, command.color, command.thickness);
},
[&](FillEllipse const& command) {
return executor.fill_ellipse(command.rect, command.color, command.blend_mode);
return executor.fill_ellipse(command.rect, command.color);
},
[&](DrawLine const& command) {
return executor.draw_line(command.color, command.from, command.to, command.thickness,

View file

@ -74,7 +74,7 @@ public:
virtual CommandResult stroke_path_using_color(Gfx::Path const&, Color const& color, float thickness, Gfx::FloatPoint const& aa_translation) = 0;
virtual CommandResult stroke_path_using_paint_style(Gfx::Path const&, Gfx::PaintStyle const& paint_style, float thickness, float opacity, Gfx::FloatPoint const& aa_translation) = 0;
virtual CommandResult draw_ellipse(Gfx::IntRect const&, Color const&, int thickness) = 0;
virtual CommandResult fill_ellipse(Gfx::IntRect const&, Color const&, Gfx::AntiAliasingPainter::BlendMode blend_mode) = 0;
virtual CommandResult fill_ellipse(Gfx::IntRect const&, Color const&) = 0;
virtual CommandResult draw_line(Color const& color, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle, Color const& alternate_color) = 0;
virtual CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const&, float smoothing) = 0;
virtual CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) = 0;

View file

@ -110,12 +110,11 @@ void RecordingPainter::draw_ellipse(Gfx::IntRect const& a_rect, Color color, int
});
}
void RecordingPainter::fill_ellipse(Gfx::IntRect const& a_rect, Color color, Gfx::AntiAliasingPainter::BlendMode blend_mode)
void RecordingPainter::fill_ellipse(Gfx::IntRect const& a_rect, Color color)
{
append(FillEllipse {
.rect = state().translation.map(a_rect),
.color = color,
.blend_mode = blend_mode,
});
}

View file

@ -82,7 +82,7 @@ public:
void draw_ellipse(Gfx::IntRect const& a_rect, Color color, int thickness);
void fill_ellipse(Gfx::IntRect const& a_rect, Color color, Gfx::AntiAliasingPainter::BlendMode blend_mode = Gfx::AntiAliasingPainter::BlendMode::Normal);
void fill_ellipse(Gfx::IntRect const& a_rect, Color color);
void fill_rect_with_linear_gradient(Gfx::IntRect const& gradient_rect, LinearGradientData const& data, Vector<Gfx::Path> const& clip_paths = {});
void fill_rect_with_conic_gradient(Gfx::IntRect const& rect, ConicGradientData const& data, Gfx::IntPoint const& position, Vector<Gfx::Path> const& clip_paths = {});