From de6d99e94005b5f5b66b1bf9b83f358d75cc3d69 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 19 Jun 2024 15:03:04 +0300 Subject: [PATCH] LibWeb: Respect selected painter in SVGDecodedImageData Now SVGDecodedImageData uses Skia painter, if it's selected. --- .../LibWeb/SVG/SVGDecodedImageData.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp index ae134b7d73f..1cf52888f2d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -94,10 +95,26 @@ RefPtr SVGDecodedImageData::render(Gfx::IntSize size) const Painting::CommandList painting_commands; Painting::RecordingPainter recording_painter(painting_commands); - Painting::CommandExecutorCPU executor { *bitmap }; m_document->navigable()->record_painting_commands(recording_painter, {}); - painting_commands.execute(executor); + + auto painting_command_executor_type = m_page_client->painting_command_executor_type(); + switch (painting_command_executor_type) { + case PaintingCommandExecutorType::CPU: + case PaintingCommandExecutorType::CPUWithExperimentalTransformSupport: + case PaintingCommandExecutorType::GPU: { // GPU painter does not have any path rasterization support so we always fall back to CPU painter + Painting::CommandExecutorCPU executor { *bitmap }; + painting_commands.execute(executor); + break; + } + case PaintingCommandExecutorType::Skia: { + Painting::CommandExecutorSkia executor { *bitmap }; + painting_commands.execute(executor); + break; + } + default: + VERIFY_NOT_REACHED(); + } return bitmap; }