mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Remove painting command for drawing signed distance field
No longer used since we switched to vector paths for checkbox rendering.
This commit is contained in:
parent
20c506f597
commit
9502926b76
Notes:
sideshowbarker
2024-07-17 18:38:54 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/9502926b76 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/152
@ -227,12 +227,6 @@ CommandResult AffineCommandExecutorCPU::draw_line(DrawLine const& command)
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult AffineCommandExecutorCPU::draw_signed_distance_field(DrawSignedDistanceField const&)
|
||||
{
|
||||
// FIXME: Implement.
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult AffineCommandExecutorCPU::apply_backdrop_filter(ApplyBackdropFilter const&)
|
||||
{
|
||||
// FIXME: Implement.
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
CommandResult draw_ellipse(DrawEllipse const&) override;
|
||||
CommandResult fill_ellipse(FillEllipse const&) override;
|
||||
CommandResult draw_line(DrawLine const&) override;
|
||||
CommandResult draw_signed_distance_field(DrawSignedDistanceField const&) override;
|
||||
CommandResult apply_backdrop_filter(ApplyBackdropFilter const&) override;
|
||||
CommandResult draw_rect(DrawRect const&) override;
|
||||
CommandResult paint_radial_gradient(PaintRadialGradient const&) override;
|
||||
|
@ -286,20 +286,6 @@ struct DrawLine {
|
||||
}
|
||||
};
|
||||
|
||||
struct DrawSignedDistanceField {
|
||||
Gfx::IntRect rect;
|
||||
Color color;
|
||||
Gfx::GrayscaleBitmap sdf;
|
||||
float smoothing;
|
||||
|
||||
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }
|
||||
|
||||
void translate_by(Gfx::IntPoint const& offset)
|
||||
{
|
||||
rect.translate_by(offset);
|
||||
}
|
||||
};
|
||||
|
||||
struct ApplyBackdropFilter {
|
||||
Gfx::IntRect backdrop_region;
|
||||
BorderRadiiData border_radii_data;
|
||||
@ -404,7 +390,6 @@ using Command = Variant<
|
||||
DrawEllipse,
|
||||
FillEllipse,
|
||||
DrawLine,
|
||||
DrawSignedDistanceField,
|
||||
ApplyBackdropFilter,
|
||||
DrawRect,
|
||||
DrawTriangleWave,
|
||||
|
@ -381,12 +381,6 @@ CommandResult CommandExecutorCPU::draw_line(DrawLine const& command)
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult CommandExecutorCPU::draw_signed_distance_field(DrawSignedDistanceField const& command)
|
||||
{
|
||||
painter().draw_signed_distance_field(command.rect, command.color, command.sdf, command.smoothing);
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult CommandExecutorCPU::apply_backdrop_filter(ApplyBackdropFilter const& command)
|
||||
{
|
||||
auto& painter = this->painter();
|
||||
|
@ -36,7 +36,6 @@ public:
|
||||
CommandResult draw_ellipse(DrawEllipse const&) override;
|
||||
CommandResult fill_ellipse(FillEllipse const&) override;
|
||||
CommandResult draw_line(DrawLine const&) override;
|
||||
CommandResult draw_signed_distance_field(DrawSignedDistanceField const&) override;
|
||||
CommandResult apply_backdrop_filter(ApplyBackdropFilter const&) override;
|
||||
CommandResult draw_rect(DrawRect const&) override;
|
||||
CommandResult paint_radial_gradient(PaintRadialGradient const&) override;
|
||||
|
@ -268,12 +268,6 @@ CommandResult CommandExecutorGPU::draw_line(DrawLine const& command)
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult CommandExecutorGPU::draw_signed_distance_field(DrawSignedDistanceField const&)
|
||||
{
|
||||
// FIXME
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult CommandExecutorGPU::apply_backdrop_filter(ApplyBackdropFilter const&)
|
||||
{
|
||||
// FIXME
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
CommandResult draw_ellipse(DrawEllipse const&) override;
|
||||
CommandResult fill_ellipse(FillEllipse const&) override;
|
||||
CommandResult draw_line(DrawLine const&) override;
|
||||
CommandResult draw_signed_distance_field(DrawSignedDistanceField const&) override;
|
||||
CommandResult apply_backdrop_filter(ApplyBackdropFilter const&) override;
|
||||
CommandResult draw_rect(DrawRect const&) override;
|
||||
CommandResult paint_radial_gradient(PaintRadialGradient const&) override;
|
||||
|
@ -172,7 +172,6 @@ void CommandList::execute(CommandExecutor& executor)
|
||||
else HANDLE_COMMAND(DrawEllipse, draw_ellipse)
|
||||
else HANDLE_COMMAND(FillEllipse, fill_ellipse)
|
||||
else HANDLE_COMMAND(DrawLine, draw_line)
|
||||
else HANDLE_COMMAND(DrawSignedDistanceField, draw_signed_distance_field)
|
||||
else HANDLE_COMMAND(ApplyBackdropFilter, apply_backdrop_filter)
|
||||
else HANDLE_COMMAND(DrawRect, draw_rect)
|
||||
else HANDLE_COMMAND(DrawTriangleWave, draw_triangle_wave)
|
||||
|
@ -70,7 +70,6 @@ public:
|
||||
virtual CommandResult draw_ellipse(DrawEllipse const&) = 0;
|
||||
virtual CommandResult fill_ellipse(FillEllipse const&) = 0;
|
||||
virtual CommandResult draw_line(DrawLine const&) = 0;
|
||||
virtual CommandResult draw_signed_distance_field(DrawSignedDistanceField const&) = 0;
|
||||
virtual CommandResult apply_backdrop_filter(ApplyBackdropFilter const&) = 0;
|
||||
virtual CommandResult draw_rect(DrawRect const&) = 0;
|
||||
virtual CommandResult draw_triangle_wave(DrawTriangleWave const&) = 0;
|
||||
|
@ -237,18 +237,6 @@ void RecordingPainter::draw_text(Gfx::IntRect const& rect, String raw_text, Gfx:
|
||||
});
|
||||
}
|
||||
|
||||
void RecordingPainter::draw_signed_distance_field(Gfx::IntRect const& dst_rect, Color color, Gfx::GrayscaleBitmap const& sdf, float smoothing)
|
||||
{
|
||||
if (dst_rect.is_empty())
|
||||
return;
|
||||
append(DrawSignedDistanceField {
|
||||
.rect = state().translation.map(dst_rect),
|
||||
.color = color,
|
||||
.sdf = sdf,
|
||||
.smoothing = smoothing,
|
||||
});
|
||||
}
|
||||
|
||||
void RecordingPainter::draw_text_run(Gfx::IntPoint baseline_start, Gfx::GlyphRun const& glyph_run, Color color, Gfx::IntRect const& rect, double scale)
|
||||
{
|
||||
if (rect.is_empty())
|
||||
|
@ -97,8 +97,6 @@ public:
|
||||
|
||||
void draw_text(Gfx::IntRect const&, String, Gfx::Font const&, Gfx::TextAlignment = Gfx::TextAlignment::TopLeft, Color = Color::Black, Gfx::TextElision = Gfx::TextElision::None, Gfx::TextWrapping = Gfx::TextWrapping::DontWrap);
|
||||
|
||||
void draw_signed_distance_field(Gfx::IntRect const& dst_rect, Color color, Gfx::GrayscaleBitmap const& sdf, float smoothing);
|
||||
|
||||
// Streamlined text drawing routine that does no wrapping/elision/alignment.
|
||||
void draw_text_run(Gfx::IntPoint baseline_start, Gfx::GlyphRun const& glyph_run, Color color, Gfx::IntRect const& rect, double scale);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user