From 23f62808174fb010b7c55d262d12d817cbf37f5f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 21 Jun 2024 08:00:49 +0200 Subject: [PATCH] LibWeb: Remove the now-unused DrawText display list command --- Userland/Libraries/LibWeb/Painting/Command.h | 14 -------------- .../LibWeb/Painting/CommandExecutorCPU.cpp | 7 ------- .../Libraries/LibWeb/Painting/CommandExecutorCPU.h | 1 - .../LibWeb/Painting/CommandExecutorGPU.cpp | 6 ------ .../Libraries/LibWeb/Painting/CommandExecutorGPU.h | 1 - .../LibWeb/Painting/CommandExecutorSkia.cpp | 5 ----- .../LibWeb/Painting/CommandExecutorSkia.h | 1 - Userland/Libraries/LibWeb/Painting/CommandList.cpp | 1 - Userland/Libraries/LibWeb/Painting/CommandList.h | 1 - 9 files changed, 37 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/Command.h b/Userland/Libraries/LibWeb/Painting/Command.h index 6407a24bad2..868b3bd9799 100644 --- a/Userland/Libraries/LibWeb/Painting/Command.h +++ b/Userland/Libraries/LibWeb/Painting/Command.h @@ -49,19 +49,6 @@ struct DrawGlyphRun { void translate_by(Gfx::IntPoint const& offset); }; -struct DrawText { - Gfx::IntRect rect; - String raw_text; - Gfx::TextAlignment alignment; - Color color; - Gfx::TextElision elision; - Gfx::TextWrapping wrapping; - NonnullRefPtr font; - - [[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; } - void translate_by(Gfx::IntPoint const& offset) { rect.translate_by(offset); } -}; - struct FillRect { Gfx::IntRect rect; Color color; @@ -369,7 +356,6 @@ struct BlitCornerClipping { using Command = Variant< DrawGlyphRun, - DrawText, FillRect, DrawScaledBitmap, DrawScaledImmutableBitmap, diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp index 175a9fcf792..87c925efe77 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp @@ -47,13 +47,6 @@ CommandResult CommandExecutorCPU::draw_glyph_run(DrawGlyphRun const& command) return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_text(DrawText const& command) -{ - auto& painter = this->painter(); - painter.draw_text(command.rect, command.raw_text, command.font, command.alignment, command.color, command.elision, command.wrapping); - return CommandResult::Continue; -} - template void apply_clip_paths_to_painter(Gfx::IntRect const& rect, Callback callback, Vector const& clip_paths, Gfx::Painter& target_painter) { diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h index 2e6313aa3a6..4458584ec9a 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h @@ -15,7 +15,6 @@ namespace Web::Painting { class CommandExecutorCPU : public CommandExecutor { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; - CommandResult draw_text(DrawText const&) override; CommandResult fill_rect(FillRect const&) override; CommandResult draw_scaled_bitmap(DrawScaledBitmap const&) override; CommandResult draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const&) override; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp index adb22f2e021..e46d458206a 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp @@ -48,12 +48,6 @@ CommandResult CommandExecutorGPU::draw_glyph_run(DrawGlyphRun const& command) return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_text(DrawText const&) -{ - // FIXME - return CommandResult::Continue; -} - CommandResult CommandExecutorGPU::fill_rect(FillRect const& command) { // FIXME: Support clip paths diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h index 9bf4323114e..f0939018900 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h @@ -15,7 +15,6 @@ namespace Web::Painting { class CommandExecutorGPU : public CommandExecutor { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; - CommandResult draw_text(DrawText const&) override; CommandResult fill_rect(FillRect const&) override; CommandResult draw_scaled_bitmap(DrawScaledBitmap const&) override; CommandResult draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const&) override; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp index 439374551e9..2d0e0ad6879 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp @@ -245,11 +245,6 @@ CommandResult CommandExecutorSkia::draw_glyph_run(DrawGlyphRun const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_text(DrawText const&) -{ - return CommandResult::Continue; -} - CommandResult CommandExecutorSkia::fill_rect(FillRect const& command) { APPLY_PATH_CLIP_IF_NEEDED diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h b/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h index fd350175f15..86ae0495df1 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h @@ -14,7 +14,6 @@ namespace Web::Painting { class CommandExecutorSkia : public CommandExecutor { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; - CommandResult draw_text(DrawText const&) override; CommandResult fill_rect(FillRect const&) override; CommandResult draw_scaled_bitmap(DrawScaledBitmap const&) override; CommandResult draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const&) override; diff --git a/Userland/Libraries/LibWeb/Painting/CommandList.cpp b/Userland/Libraries/LibWeb/Painting/CommandList.cpp index 5fe373341c0..6fa2555bbaa 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandList.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandList.cpp @@ -148,7 +148,6 @@ void CommandList::execute(CommandExecutor& executor) // clang-format off CommandResult result; HANDLE_COMMAND(DrawGlyphRun, draw_glyph_run) - else HANDLE_COMMAND(DrawText, draw_text) else HANDLE_COMMAND(FillRect, fill_rect) else HANDLE_COMMAND(DrawScaledBitmap, draw_scaled_bitmap) else HANDLE_COMMAND(DrawScaledImmutableBitmap, draw_scaled_immutable_bitmap) diff --git a/Userland/Libraries/LibWeb/Painting/CommandList.h b/Userland/Libraries/LibWeb/Painting/CommandList.h index 4126a957f55..f7e26d328a5 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandList.h +++ b/Userland/Libraries/LibWeb/Painting/CommandList.h @@ -46,7 +46,6 @@ public: virtual ~CommandExecutor() = default; virtual CommandResult draw_glyph_run(DrawGlyphRun const&) = 0; - virtual CommandResult draw_text(DrawText const&) = 0; virtual CommandResult fill_rect(FillRect const&) = 0; virtual CommandResult draw_scaled_bitmap(DrawScaledBitmap const&) = 0; virtual CommandResult draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const&) = 0;