diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/Painting/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWeb/Painting/BUILD.gn index 83a889adcc1..e4b8b2969cb 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/Painting/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/Painting/BUILD.gn @@ -15,8 +15,8 @@ source_set("Painting") { "CheckBoxPaintable.cpp", "ClippableAndScrollable.cpp", "Command.cpp", - "CommandExecutorCPU.cpp", "DisplayList.cpp", + "DisplayListPlayerCPU.cpp", "DisplayListRecorder.cpp", "FilterPainting.cpp", "GradientPainting.cpp", @@ -48,7 +48,7 @@ source_set("Painting") { ] if (current_os == "linux" || current_os == "mac") { - sources += [ "CommandExecutorGPU.cpp" ] + sources += [ "DisplayListPlayerGPU.cpp" ] public_deps = [ "//Userland/Libraries/LibAccelGfx" ] } } diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 55fe2e6d745..e78f63d6159 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -539,11 +539,11 @@ set(SOURCES Painting/BordersData.cpp Painting/CanvasPaintable.cpp Painting/Command.cpp - Painting/CommandExecutorCPU.cpp - Painting/CommandExecutorSkia.cpp Painting/CheckBoxPaintable.cpp Painting/ClippableAndScrollable.cpp Painting/DisplayList.cpp + Painting/DisplayListPlayerCPU.cpp + Painting/DisplayListPlayerSkia.cpp Painting/DisplayListRecorder.cpp Painting/GradientPainting.cpp Painting/FilterPainting.cpp @@ -760,7 +760,7 @@ target_link_libraries(LibWeb PRIVATE LibCore LibCrypto LibJS LibHTTP LibGfx LibI if (HAS_ACCELERATED_GRAPHICS) target_link_libraries(LibWeb PRIVATE ${ACCEL_GFX_LIBS}) - target_sources(LibWeb PRIVATE Painting/CommandExecutorGPU.cpp) + target_sources(LibWeb PRIVATE Painting/DisplayListPlayerGPU.cpp) target_link_libraries(LibWeb PRIVATE LibAccelGfx) target_compile_definitions(LibWeb PRIVATE HAS_ACCELERATED_GRAPHICS) endif() diff --git a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp index 96c93340b8c..a1760d60735 100644 --- a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp @@ -17,12 +17,12 @@ #include #include #include -#include -#include +#include +#include #include #ifdef HAS_ACCELERATED_GRAPHICS -# include +# include #endif namespace Web::HTML { @@ -1188,11 +1188,11 @@ void TraversableNavigable::paint(Web::DevicePixelRect const& content_rect, Gfx:: paint_config.has_focus = paint_options.has_focus; record_display_list(display_list_recorder, paint_config); - auto painting_command_executor_type = page().client().painting_command_executor_type(); - if (painting_command_executor_type == PaintingCommandExecutorType::GPU) { + auto display_list_player_type = page().client().display_list_player_type(); + if (display_list_player_type == DisplayListPlayerType::GPU) { #ifdef HAS_ACCELERATED_GRAPHICS - Web::Painting::CommandExecutorGPU painting_command_executor(*paint_options.accelerated_graphics_context, target); - display_list.execute(painting_command_executor); + Web::Painting::DisplayListPlayerGPU player(*paint_options.accelerated_graphics_context, target); + display_list.execute(player); #else static bool has_warned_about_configuration = false; @@ -1201,12 +1201,12 @@ void TraversableNavigable::paint(Web::DevicePixelRect const& content_rect, Gfx:: has_warned_about_configuration = true; } #endif - } else if (painting_command_executor_type == PaintingCommandExecutorType::Skia) { - Painting::CommandExecutorSkia painting_command_executor(target); - display_list.execute(painting_command_executor); + } else if (display_list_player_type == DisplayListPlayerType::Skia) { + Painting::DisplayListPlayerSkia player(target); + display_list.execute(player); } else { - Web::Painting::CommandExecutorCPU painting_command_executor(target); - display_list.execute(painting_command_executor); + Web::Painting::DisplayListPlayerCPU player(target); + display_list.execute(player); } } diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 1a39cc7ba44..2011013737f 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -278,7 +278,7 @@ struct PaintOptions { #endif }; -enum class PaintingCommandExecutorType { +enum class DisplayListPlayerType { CPU, GPU, Skia @@ -378,7 +378,7 @@ public: virtual void schedule_repaint() = 0; virtual bool is_ready_to_paint() const = 0; - virtual PaintingCommandExecutorType painting_command_executor_type() const = 0; + virtual DisplayListPlayerType display_list_player_type() const = 0; protected: virtual ~PageClient() = default; diff --git a/Userland/Libraries/LibWeb/Painting/DisplayList.cpp b/Userland/Libraries/LibWeb/Painting/DisplayList.cpp index 78bc9d32f17..f0e2b4193a2 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayList.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayList.cpp @@ -76,7 +76,7 @@ void DisplayList::mark_unnecessary_commands() VERIFY(sample_blit_ranges.is_empty()); } -void DisplayList::execute(CommandExecutor& executor) +void DisplayList::execute(DisplayListPlayer& executor) { executor.prepare_to_execute(m_corner_clip_max_depth); diff --git a/Userland/Libraries/LibWeb/Painting/DisplayList.h b/Userland/Libraries/LibWeb/Painting/DisplayList.h index bc6209753ac..91fc2432762 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayList.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayList.h @@ -37,9 +37,9 @@ enum class CommandResult { SkipStackingContext, }; -class CommandExecutor { +class DisplayListPlayer { public: - virtual ~CommandExecutor() = default; + virtual ~DisplayListPlayer() = default; virtual CommandResult draw_glyph_run(DrawGlyphRun const&) = 0; virtual CommandResult fill_rect(FillRect const&) = 0; @@ -83,7 +83,7 @@ public: void apply_scroll_offsets(Vector const& offsets_by_frame_id); void mark_unnecessary_commands(); - void execute(CommandExecutor&); + void execute(DisplayListPlayer&); size_t corner_clip_max_depth() const { return m_corner_clip_max_depth; } void set_corner_clip_max_depth(size_t depth) { m_corner_clip_max_depth = depth; } diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp similarity index 87% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp index 29634cb37f6..b842172c59e 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp @@ -8,14 +8,14 @@ #include #include #include -#include +#include #include #include #include namespace Web::Painting { -CommandExecutorCPU::CommandExecutorCPU(Gfx::Bitmap& bitmap) +DisplayListPlayerCPU::DisplayListPlayerCPU(Gfx::Bitmap& bitmap) : m_target_bitmap(bitmap) { stacking_contexts.append({ .painter = AK::make(bitmap), @@ -24,9 +24,9 @@ CommandExecutorCPU::CommandExecutorCPU(Gfx::Bitmap& bitmap) .scaling_mode = {} }); } -CommandExecutorCPU::~CommandExecutorCPU() = default; +DisplayListPlayerCPU::~DisplayListPlayerCPU() = default; -CommandResult CommandExecutorCPU::draw_glyph_run(DrawGlyphRun const& command) +CommandResult DisplayListPlayerCPU::draw_glyph_run(DrawGlyphRun const& command) { auto& painter = this->painter(); auto const& glyphs = command.glyph_run->glyphs(); @@ -69,7 +69,7 @@ void apply_clip_paths_to_painter(Gfx::IntRect const& rect, Callback callback, Ve } } -CommandResult CommandExecutorCPU::fill_rect(FillRect const& command) +CommandResult DisplayListPlayerCPU::fill_rect(FillRect const& command) { auto paint_op = [&](Gfx::Painter& painter) { painter.fill_rect(command.rect, command.color); @@ -82,14 +82,14 @@ CommandResult CommandExecutorCPU::fill_rect(FillRect const& command) return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_scaled_bitmap(DrawScaledBitmap const& command) +CommandResult DisplayListPlayerCPU::draw_scaled_bitmap(DrawScaledBitmap const& command) { auto& painter = this->painter(); painter.draw_scaled_bitmap(command.dst_rect, command.bitmap, command.src_rect, 1, command.scaling_mode); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) +CommandResult DisplayListPlayerCPU::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) { auto paint_op = [&](Gfx::Painter& painter) { painter.draw_scaled_bitmap(command.dst_rect, command.bitmap->bitmap(), command.src_rect, 1, command.scaling_mode); @@ -102,25 +102,25 @@ CommandResult CommandExecutorCPU::draw_scaled_immutable_bitmap(DrawScaledImmutab return CommandResult::Continue; } -CommandResult CommandExecutorCPU::save(Save const&) +CommandResult DisplayListPlayerCPU::save(Save const&) { painter().save(); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::restore(Restore const&) +CommandResult DisplayListPlayerCPU::restore(Restore const&) { painter().restore(); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::add_clip_rect(AddClipRect const& command) +CommandResult DisplayListPlayerCPU::add_clip_rect(AddClipRect const& command) { painter().add_clip_rect(command.rect); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::push_stacking_context(PushStackingContext const& command) +CommandResult DisplayListPlayerCPU::push_stacking_context(PushStackingContext const& command) { // FIXME: This extracts the affine 2D part of the full transformation matrix. // Use the whole matrix when we get better transformation support in LibGfx or use LibGL for drawing the bitmap @@ -207,7 +207,7 @@ CommandResult CommandExecutorCPU::push_stacking_context(PushStackingContext cons return CommandResult::Continue; } -CommandResult CommandExecutorCPU::pop_stacking_context(PopStackingContext const&) +CommandResult DisplayListPlayerCPU::pop_stacking_context(PopStackingContext const&) { ScopeGuard restore_painter = [&] { painter().restore(); @@ -228,7 +228,7 @@ CommandResult CommandExecutorCPU::pop_stacking_context(PopStackingContext const& return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_linear_gradient(PaintLinearGradient const& command) +CommandResult DisplayListPlayerCPU::paint_linear_gradient(PaintLinearGradient const& command) { auto const& linear_gradient_data = command.linear_gradient_data; auto paint_op = [&](Gfx::Painter& painter) { @@ -244,21 +244,21 @@ CommandResult CommandExecutorCPU::paint_linear_gradient(PaintLinearGradient cons return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_outer_box_shadow(PaintOuterBoxShadow const& command) +CommandResult DisplayListPlayerCPU::paint_outer_box_shadow(PaintOuterBoxShadow const& command) { auto& painter = this->painter(); Web::Painting::paint_outer_box_shadow(painter, command.box_shadow_params); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_inner_box_shadow(PaintInnerBoxShadow const& command) +CommandResult DisplayListPlayerCPU::paint_inner_box_shadow(PaintInnerBoxShadow const& command) { auto& painter = this->painter(); Web::Painting::paint_inner_box_shadow(painter, command.box_shadow_params); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_text_shadow(PaintTextShadow const& command) +CommandResult DisplayListPlayerCPU::paint_text_shadow(PaintTextShadow const& command) { // FIXME: Figure out the maximum bitmap size for all shadows and then allocate it once and reuse it? auto maybe_shadow_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, command.shadow_bounding_rect.size()); @@ -290,7 +290,7 @@ CommandResult CommandExecutorCPU::paint_text_shadow(PaintTextShadow const& comma return CommandResult::Continue; } -CommandResult CommandExecutorCPU::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) +CommandResult DisplayListPlayerCPU::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) { auto paint_op = [&](Gfx::Painter& painter) { Gfx::AntiAliasingPainter aa_painter(painter); @@ -310,7 +310,7 @@ CommandResult CommandExecutorCPU::fill_rect_with_rounded_corners(FillRectWithRou return CommandResult::Continue; } -CommandResult CommandExecutorCPU::fill_path_using_color(FillPathUsingColor const& command) +CommandResult DisplayListPlayerCPU::fill_path_using_color(FillPathUsingColor const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); aa_painter.translate(command.aa_translation); @@ -318,7 +318,7 @@ CommandResult CommandExecutorCPU::fill_path_using_color(FillPathUsingColor const return CommandResult::Continue; } -CommandResult CommandExecutorCPU::fill_path_using_paint_style(FillPathUsingPaintStyle const& command) +CommandResult DisplayListPlayerCPU::fill_path_using_paint_style(FillPathUsingPaintStyle const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); auto gfx_paint_style = command.paint_style->create_gfx_paint_style(); @@ -327,7 +327,7 @@ CommandResult CommandExecutorCPU::fill_path_using_paint_style(FillPathUsingPaint return CommandResult::Continue; } -CommandResult CommandExecutorCPU::stroke_path_using_color(StrokePathUsingColor const& command) +CommandResult DisplayListPlayerCPU::stroke_path_using_color(StrokePathUsingColor const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); aa_painter.translate(command.aa_translation); @@ -335,7 +335,7 @@ CommandResult CommandExecutorCPU::stroke_path_using_color(StrokePathUsingColor c return CommandResult::Continue; } -CommandResult CommandExecutorCPU::stroke_path_using_paint_style(StrokePathUsingPaintStyle const& command) +CommandResult DisplayListPlayerCPU::stroke_path_using_paint_style(StrokePathUsingPaintStyle const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); auto gfx_paint_style = command.paint_style->create_gfx_paint_style(); @@ -344,21 +344,21 @@ CommandResult CommandExecutorCPU::stroke_path_using_paint_style(StrokePathUsingP return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_ellipse(DrawEllipse const& command) +CommandResult DisplayListPlayerCPU::draw_ellipse(DrawEllipse const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); aa_painter.draw_ellipse(command.rect, command.color, command.thickness); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::fill_ellipse(FillEllipse const& command) +CommandResult DisplayListPlayerCPU::fill_ellipse(FillEllipse const& command) { Gfx::AntiAliasingPainter aa_painter(painter()); aa_painter.fill_ellipse(command.rect, command.color); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_line(DrawLine const& command) +CommandResult DisplayListPlayerCPU::draw_line(DrawLine const& command) { if (command.style == Gfx::LineStyle::Dotted) { Gfx::AntiAliasingPainter aa_painter(painter()); @@ -369,7 +369,7 @@ CommandResult CommandExecutorCPU::draw_line(DrawLine const& command) return CommandResult::Continue; } -CommandResult CommandExecutorCPU::apply_backdrop_filter(ApplyBackdropFilter const& command) +CommandResult DisplayListPlayerCPU::apply_backdrop_filter(ApplyBackdropFilter const& command) { auto& painter = this->painter(); @@ -406,13 +406,13 @@ CommandResult CommandExecutorCPU::apply_backdrop_filter(ApplyBackdropFilter cons return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_rect(DrawRect const& command) +CommandResult DisplayListPlayerCPU::draw_rect(DrawRect const& command) { painter().draw_rect(command.rect, command.color, command.rough); return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_radial_gradient(PaintRadialGradient const& command) +CommandResult DisplayListPlayerCPU::paint_radial_gradient(PaintRadialGradient const& command) { auto paint_op = [&](Gfx::Painter& painter) { painter.fill_rect_with_radial_gradient(command.rect, command.radial_gradient_data.color_stops.list, command.center, command.size, command.radial_gradient_data.color_stops.repeat_length); @@ -425,7 +425,7 @@ CommandResult CommandExecutorCPU::paint_radial_gradient(PaintRadialGradient cons return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_conic_gradient(PaintConicGradient const& command) +CommandResult DisplayListPlayerCPU::paint_conic_gradient(PaintConicGradient const& command) { auto paint_op = [&](Gfx::Painter& painter) { painter.fill_rect_with_conic_gradient(command.rect, command.conic_gradient_data.color_stops.list, command.position, command.conic_gradient_data.start_angle, command.conic_gradient_data.color_stops.repeat_length); @@ -438,18 +438,18 @@ CommandResult CommandExecutorCPU::paint_conic_gradient(PaintConicGradient const& return CommandResult::Continue; } -CommandResult CommandExecutorCPU::draw_triangle_wave(DrawTriangleWave const& command) +CommandResult DisplayListPlayerCPU::draw_triangle_wave(DrawTriangleWave const& command) { painter().draw_triangle_wave(command.p1, command.p2, command.color, command.amplitude, command.thickness); return CommandResult::Continue; } -void CommandExecutorCPU::prepare_to_execute(size_t corner_clip_max_depth) +void DisplayListPlayerCPU::prepare_to_execute(size_t corner_clip_max_depth) { m_corner_clippers_stack.ensure_capacity(corner_clip_max_depth); } -CommandResult CommandExecutorCPU::sample_under_corners(SampleUnderCorners const& command) +CommandResult DisplayListPlayerCPU::sample_under_corners(SampleUnderCorners const& command) { auto clipper = BorderRadiusCornerClipper::create(command.corner_radii, command.border_rect.to_type(), command.corner_clip).release_value(); clipper->sample_under_corners(painter()); @@ -457,14 +457,14 @@ CommandResult CommandExecutorCPU::sample_under_corners(SampleUnderCorners const& return CommandResult::Continue; } -CommandResult CommandExecutorCPU::blit_corner_clipping(BlitCornerClipping const&) +CommandResult DisplayListPlayerCPU::blit_corner_clipping(BlitCornerClipping const&) { auto clipper = m_corner_clippers_stack.take_last(); clipper->blit_corner_clipping(painter()); return CommandResult::Continue; } -bool CommandExecutorCPU::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const +bool DisplayListPlayerCPU::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const { return !painter().clip_rect().intersects(rect.translated(painter().translation())); } diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h similarity index 96% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h index e22dc1b758c..22909e2c487 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h @@ -12,7 +12,7 @@ namespace Web::Painting { -class CommandExecutorCPU : public CommandExecutor { +class DisplayListPlayerCPU : public DisplayListPlayer { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; CommandResult fill_rect(FillRect const&) override; @@ -53,8 +53,8 @@ public: bool needs_update_immutable_bitmap_texture_cache() const override { return false; } void update_immutable_bitmap_texture_cache(HashMap&) override {}; - CommandExecutorCPU(Gfx::Bitmap& bitmap); - ~CommandExecutorCPU(); + DisplayListPlayerCPU(Gfx::Bitmap& bitmap); + ~DisplayListPlayerCPU(); private: Gfx::Bitmap& m_target_bitmap; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp similarity index 83% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp index e46d458206a..eb09d132b3a 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp @@ -6,11 +6,11 @@ #include #include -#include +#include namespace Web::Painting { -CommandExecutorGPU::CommandExecutorGPU(AccelGfx::Context& context, Gfx::Bitmap& bitmap) +DisplayListPlayerGPU::DisplayListPlayerGPU(AccelGfx::Context& context, Gfx::Bitmap& bitmap) : m_target_bitmap(bitmap) , m_context(context) { @@ -24,14 +24,14 @@ CommandExecutorGPU::CommandExecutorGPU(AccelGfx::Context& context, Gfx::Bitmap& .transform = {} }); } -CommandExecutorGPU::~CommandExecutorGPU() +DisplayListPlayerGPU::~DisplayListPlayerGPU() { m_context.activate(); VERIFY(m_stacking_contexts.size() == 1); painter().flush(m_target_bitmap); } -CommandResult CommandExecutorGPU::draw_glyph_run(DrawGlyphRun const& command) +CommandResult DisplayListPlayerGPU::draw_glyph_run(DrawGlyphRun const& command) { Vector transformed_glyph_run; auto const& glyphs = command.glyph_run->glyphs(); @@ -48,7 +48,7 @@ CommandResult CommandExecutorGPU::draw_glyph_run(DrawGlyphRun const& command) return CommandResult::Continue; } -CommandResult CommandExecutorGPU::fill_rect(FillRect const& command) +CommandResult DisplayListPlayerGPU::fill_rect(FillRect const& command) { // FIXME: Support clip paths painter().fill_rect(command.rect, command.color); @@ -70,38 +70,38 @@ static AccelGfx::Painter::ScalingMode to_accelgfx_scaling_mode(Gfx::ScalingMode } } -CommandResult CommandExecutorGPU::draw_scaled_bitmap(DrawScaledBitmap const& command) +CommandResult DisplayListPlayerGPU::draw_scaled_bitmap(DrawScaledBitmap const& command) { painter().draw_scaled_bitmap(command.dst_rect, command.bitmap, command.src_rect, to_accelgfx_scaling_mode(command.scaling_mode)); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) +CommandResult DisplayListPlayerGPU::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) { // TODO: Support clip paths painter().draw_scaled_immutable_bitmap(command.dst_rect, command.bitmap, command.src_rect, to_accelgfx_scaling_mode(command.scaling_mode)); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::save(Save const&) +CommandResult DisplayListPlayerGPU::save(Save const&) { painter().save(); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::restore(Restore const&) +CommandResult DisplayListPlayerGPU::restore(Restore const&) { painter().restore(); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::add_clip_rect(AddClipRect const& command) +CommandResult DisplayListPlayerGPU::add_clip_rect(AddClipRect const& command) { painter().set_clip_rect(command.rect); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::push_stacking_context(PushStackingContext const& command) +CommandResult DisplayListPlayerGPU::push_stacking_context(PushStackingContext const& command) { if (command.source_paintable_rect.is_empty()) return CommandResult::SkipStackingContext; @@ -151,7 +151,7 @@ CommandResult CommandExecutorGPU::push_stacking_context(PushStackingContext cons return CommandResult::Continue; } -CommandResult CommandExecutorGPU::pop_stacking_context(PopStackingContext const&) +CommandResult DisplayListPlayerGPU::pop_stacking_context(PopStackingContext const&) { auto stacking_context = m_stacking_contexts.take_last(); VERIFY(stacking_context.stacking_context_depth == 0); @@ -163,7 +163,7 @@ CommandResult CommandExecutorGPU::pop_stacking_context(PopStackingContext const& return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_linear_gradient(PaintLinearGradient const& command) +CommandResult DisplayListPlayerGPU::paint_linear_gradient(PaintLinearGradient const& command) { // FIXME: Support clip paths auto const& linear_gradient_data = command.linear_gradient_data; @@ -171,19 +171,19 @@ CommandResult CommandExecutorGPU::paint_linear_gradient(PaintLinearGradient cons return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_outer_box_shadow(PaintOuterBoxShadow const&) +CommandResult DisplayListPlayerGPU::paint_outer_box_shadow(PaintOuterBoxShadow const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_inner_box_shadow(PaintInnerBoxShadow const&) +CommandResult DisplayListPlayerGPU::paint_inner_box_shadow(PaintInnerBoxShadow const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_text_shadow(PaintTextShadow const& command) +CommandResult DisplayListPlayerGPU::paint_text_shadow(PaintTextShadow const& command) { auto text_shadow_canvas = AccelGfx::Canvas::create(command.shadow_bounding_rect.size()); auto text_shadow_painter = AccelGfx::Painter::create(m_context, text_shadow_canvas); @@ -206,7 +206,7 @@ CommandResult CommandExecutorGPU::paint_text_shadow(PaintTextShadow const& comma return CommandResult::Continue; } -CommandResult CommandExecutorGPU::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) +CommandResult DisplayListPlayerGPU::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) { // FIXME: Support clip paths painter().fill_rect_with_rounded_corners( @@ -218,37 +218,37 @@ CommandResult CommandExecutorGPU::fill_rect_with_rounded_corners(FillRectWithRou return CommandResult::Continue; } -CommandResult CommandExecutorGPU::fill_path_using_color(FillPathUsingColor const&) +CommandResult DisplayListPlayerGPU::fill_path_using_color(FillPathUsingColor const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::fill_path_using_paint_style(FillPathUsingPaintStyle const&) +CommandResult DisplayListPlayerGPU::fill_path_using_paint_style(FillPathUsingPaintStyle const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::stroke_path_using_color(StrokePathUsingColor const&) +CommandResult DisplayListPlayerGPU::stroke_path_using_color(StrokePathUsingColor const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::stroke_path_using_paint_style(StrokePathUsingPaintStyle const&) +CommandResult DisplayListPlayerGPU::stroke_path_using_paint_style(StrokePathUsingPaintStyle const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_ellipse(DrawEllipse const&) +CommandResult DisplayListPlayerGPU::draw_ellipse(DrawEllipse const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::fill_ellipse(FillEllipse const& command) +CommandResult DisplayListPlayerGPU::fill_ellipse(FillEllipse const& command) { auto horizontal_radius = static_cast(command.rect.width() / 2); auto vertical_radius = static_cast(command.rect.height() / 2); @@ -261,44 +261,44 @@ CommandResult CommandExecutorGPU::fill_ellipse(FillEllipse const& command) return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_line(DrawLine const& command) +CommandResult DisplayListPlayerGPU::draw_line(DrawLine const& command) { // FIXME: Pass line style and alternate color once AccelGfx::Painter supports it painter().draw_line(command.from, command.to, command.thickness, command.color); return CommandResult::Continue; } -CommandResult CommandExecutorGPU::apply_backdrop_filter(ApplyBackdropFilter const&) +CommandResult DisplayListPlayerGPU::apply_backdrop_filter(ApplyBackdropFilter const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_rect(DrawRect const&) +CommandResult DisplayListPlayerGPU::draw_rect(DrawRect const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_radial_gradient(PaintRadialGradient const&) +CommandResult DisplayListPlayerGPU::paint_radial_gradient(PaintRadialGradient const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_conic_gradient(PaintConicGradient const&) +CommandResult DisplayListPlayerGPU::paint_conic_gradient(PaintConicGradient const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::draw_triangle_wave(DrawTriangleWave const&) +CommandResult DisplayListPlayerGPU::draw_triangle_wave(DrawTriangleWave const&) { // FIXME return CommandResult::Continue; } -CommandResult CommandExecutorGPU::sample_under_corners(SampleUnderCorners const& command) +CommandResult DisplayListPlayerGPU::sample_under_corners(SampleUnderCorners const& command) { m_corner_clippers.resize(command.id + 1); m_corner_clippers[command.id] = make(); @@ -354,7 +354,7 @@ CommandResult CommandExecutorGPU::sample_under_corners(SampleUnderCorners const& return CommandResult::Continue; } -CommandResult CommandExecutorGPU::blit_corner_clipping(BlitCornerClipping const& command) +CommandResult DisplayListPlayerGPU::blit_corner_clipping(BlitCornerClipping const& command) { auto const& corner_clipper = *m_corner_clippers[command.id]; auto const& corner_sample_canvas = *corner_clipper.corners_sample_canvas; @@ -372,23 +372,23 @@ CommandResult CommandExecutorGPU::blit_corner_clipping(BlitCornerClipping const& return CommandResult::Continue; } -bool CommandExecutorGPU::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const +bool DisplayListPlayerGPU::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const { auto translation = painter().transform().translation().to_type(); return !painter().clip_rect().intersects(rect.translated(translation)); } -void CommandExecutorGPU::prepare_glyph_texture(HashMap> const& unique_glyphs) +void DisplayListPlayerGPU::prepare_glyph_texture(HashMap> const& unique_glyphs) { AccelGfx::GlyphAtlas::the().update(unique_glyphs); } -void CommandExecutorGPU::prepare_to_execute([[maybe_unused]] size_t corner_clip_max_depth) +void DisplayListPlayerGPU::prepare_to_execute([[maybe_unused]] size_t corner_clip_max_depth) { m_context.activate(); } -void CommandExecutorGPU::update_immutable_bitmap_texture_cache(HashMap& immutable_bitmaps) +void DisplayListPlayerGPU::update_immutable_bitmap_texture_cache(HashMap& immutable_bitmaps) { painter().update_immutable_bitmap_texture_cache(immutable_bitmaps); } diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.h similarity index 96% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.h index 32187f3be66..2a1deda10cc 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.h @@ -12,7 +12,7 @@ namespace Web::Painting { -class CommandExecutorGPU : public CommandExecutor { +class DisplayListPlayerGPU : public DisplayListPlayer { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; CommandResult fill_rect(FillRect const&) override; @@ -53,8 +53,8 @@ public: bool needs_update_immutable_bitmap_texture_cache() const override { return true; } void update_immutable_bitmap_texture_cache(HashMap&) override; - CommandExecutorGPU(AccelGfx::Context&, Gfx::Bitmap& bitmap); - ~CommandExecutorGPU() override; + DisplayListPlayerGPU(AccelGfx::Context&, Gfx::Bitmap& bitmap); + ~DisplayListPlayerGPU() override; private: Gfx::Bitmap& m_target_bitmap; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp similarity index 92% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index 2d0e0ad6879..0945ba2cc95 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -21,12 +21,12 @@ #include #include -#include +#include #include namespace Web::Painting { -class CommandExecutorSkia::SkiaSurface { +class DisplayListPlayerSkia::SkiaSurface { public: SkCanvas& canvas() const { return *surface->getCanvas(); } @@ -195,7 +195,7 @@ static SkSamplingOptions to_skia_sampling_options(Gfx::ScalingMode scaling_mode) surface().canvas().clipPath(to_skia_path(path), true); \ } -CommandExecutorSkia::CommandExecutorSkia(Gfx::Bitmap& bitmap) +DisplayListPlayerSkia::DisplayListPlayerSkia(Gfx::Bitmap& bitmap) { VERIFY(bitmap.format() == Gfx::BitmapFormat::BGRA8888); auto image_info = SkImageInfo::Make(bitmap.width(), bitmap.height(), kBGRA_8888_SkColorType, kPremul_SkAlphaType); @@ -204,14 +204,14 @@ CommandExecutorSkia::CommandExecutorSkia(Gfx::Bitmap& bitmap) m_surface = make(surface); } -CommandExecutorSkia::~CommandExecutorSkia() = default; +DisplayListPlayerSkia::~DisplayListPlayerSkia() = default; -CommandExecutorSkia::SkiaSurface& CommandExecutorSkia::surface() const +DisplayListPlayerSkia::SkiaSurface& DisplayListPlayerSkia::surface() const { return static_cast(*m_surface); } -CommandResult CommandExecutorSkia::draw_glyph_run(DrawGlyphRun const& command) +CommandResult DisplayListPlayerSkia::draw_glyph_run(DrawGlyphRun const& command) { auto& canvas = surface().canvas(); SkPaint paint; @@ -245,7 +245,7 @@ CommandResult CommandExecutorSkia::draw_glyph_run(DrawGlyphRun const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::fill_rect(FillRect const& command) +CommandResult DisplayListPlayerSkia::fill_rect(FillRect const& command) { APPLY_PATH_CLIP_IF_NEEDED @@ -257,7 +257,7 @@ CommandResult CommandExecutorSkia::fill_rect(FillRect const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_scaled_bitmap(DrawScaledBitmap const& command) +CommandResult DisplayListPlayerSkia::draw_scaled_bitmap(DrawScaledBitmap const& command) { auto src_rect = to_skia_rect(command.src_rect); auto dst_rect = to_skia_rect(command.dst_rect); @@ -269,7 +269,7 @@ CommandResult CommandExecutorSkia::draw_scaled_bitmap(DrawScaledBitmap const& co return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) +CommandResult DisplayListPlayerSkia::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) { APPLY_PATH_CLIP_IF_NEEDED @@ -283,7 +283,7 @@ CommandResult CommandExecutorSkia::draw_scaled_immutable_bitmap(DrawScaledImmuta return CommandResult::Continue; } -CommandResult CommandExecutorSkia::add_clip_rect(AddClipRect const& command) +CommandResult DisplayListPlayerSkia::add_clip_rect(AddClipRect const& command) { auto& canvas = surface().canvas(); auto const& rect = command.rect; @@ -291,14 +291,14 @@ CommandResult CommandExecutorSkia::add_clip_rect(AddClipRect const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::save(Save const&) +CommandResult DisplayListPlayerSkia::save(Save const&) { auto& canvas = surface().canvas(); canvas.save(); return CommandResult::Continue; } -CommandResult CommandExecutorSkia::restore(Restore const&) +CommandResult DisplayListPlayerSkia::restore(Restore const&) { auto& canvas = surface().canvas(); canvas.restore(); @@ -324,7 +324,7 @@ static SkBitmap alpha_mask_from_bitmap(Gfx::Bitmap const& bitmap, Gfx::Bitmap::M return alpha_mask; } -CommandResult CommandExecutorSkia::push_stacking_context(PushStackingContext const& command) +CommandResult DisplayListPlayerSkia::push_stacking_context(PushStackingContext const& command) { auto& canvas = surface().canvas(); @@ -363,13 +363,13 @@ CommandResult CommandExecutorSkia::push_stacking_context(PushStackingContext con return CommandResult::Continue; } -CommandResult CommandExecutorSkia::pop_stacking_context(PopStackingContext const&) +CommandResult DisplayListPlayerSkia::pop_stacking_context(PopStackingContext const&) { surface().canvas().restore(); return CommandResult::Continue; } -CommandResult CommandExecutorSkia::paint_linear_gradient(PaintLinearGradient const& command) +CommandResult DisplayListPlayerSkia::paint_linear_gradient(PaintLinearGradient const& command) { APPLY_PATH_CLIP_IF_NEEDED @@ -430,7 +430,7 @@ static void add_spread_distance_to_border_radius(int& border_radius, int spread_ } } -CommandResult CommandExecutorSkia::paint_outer_box_shadow(PaintOuterBoxShadow const& command) +CommandResult DisplayListPlayerSkia::paint_outer_box_shadow(PaintOuterBoxShadow const& command) { auto const& outer_box_shadow_params = command.box_shadow_params; auto const& color = outer_box_shadow_params.color; @@ -469,7 +469,7 @@ CommandResult CommandExecutorSkia::paint_outer_box_shadow(PaintOuterBoxShadow co return CommandResult::Continue; } -CommandResult CommandExecutorSkia::paint_inner_box_shadow(PaintInnerBoxShadow const& command) +CommandResult DisplayListPlayerSkia::paint_inner_box_shadow(PaintInnerBoxShadow const& command) { auto const& outer_box_shadow_params = command.box_shadow_params; auto color = outer_box_shadow_params.color; @@ -525,12 +525,12 @@ CommandResult CommandExecutorSkia::paint_inner_box_shadow(PaintInnerBoxShadow co return CommandResult::Continue; } -CommandResult CommandExecutorSkia::paint_text_shadow(PaintTextShadow const&) +CommandResult DisplayListPlayerSkia::paint_text_shadow(PaintTextShadow const&) { return CommandResult::Continue; } -CommandResult CommandExecutorSkia::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) +CommandResult DisplayListPlayerSkia::fill_rect_with_rounded_corners(FillRectWithRoundedCorners const& command) { APPLY_PATH_CLIP_IF_NEEDED @@ -552,7 +552,7 @@ CommandResult CommandExecutorSkia::fill_rect_with_rounded_corners(FillRectWithRo return CommandResult::Continue; } -CommandResult CommandExecutorSkia::fill_path_using_color(FillPathUsingColor const& command) +CommandResult DisplayListPlayerSkia::fill_path_using_color(FillPathUsingColor const& command) { auto& canvas = surface().canvas(); SkPaint paint; @@ -604,7 +604,7 @@ SkPaint paint_style_to_skia_paint(Painting::SVGGradientPaintStyle const& paint_s return paint; } -CommandResult CommandExecutorSkia::fill_path_using_paint_style(FillPathUsingPaintStyle const& command) +CommandResult DisplayListPlayerSkia::fill_path_using_paint_style(FillPathUsingPaintStyle const& command) { auto path = to_skia_path(command.path); path.offset(command.aa_translation.x(), command.aa_translation.y()); @@ -616,7 +616,7 @@ CommandResult CommandExecutorSkia::fill_path_using_paint_style(FillPathUsingPain return CommandResult::Continue; } -CommandResult CommandExecutorSkia::stroke_path_using_color(StrokePathUsingColor const& command) +CommandResult DisplayListPlayerSkia::stroke_path_using_color(StrokePathUsingColor const& command) { auto& canvas = surface().canvas(); SkPaint paint; @@ -630,7 +630,7 @@ CommandResult CommandExecutorSkia::stroke_path_using_color(StrokePathUsingColor return CommandResult::Continue; } -CommandResult CommandExecutorSkia::stroke_path_using_paint_style(StrokePathUsingPaintStyle const& command) +CommandResult DisplayListPlayerSkia::stroke_path_using_paint_style(StrokePathUsingPaintStyle const& command) { auto path = to_skia_path(command.path); path.offset(command.aa_translation.x(), command.aa_translation.y()); @@ -643,7 +643,7 @@ CommandResult CommandExecutorSkia::stroke_path_using_paint_style(StrokePathUsing return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_ellipse(DrawEllipse const& command) +CommandResult DisplayListPlayerSkia::draw_ellipse(DrawEllipse const& command) { auto const& rect = command.rect; auto& canvas = surface().canvas(); @@ -656,7 +656,7 @@ CommandResult CommandExecutorSkia::draw_ellipse(DrawEllipse const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::fill_ellipse(FillEllipse const& command) +CommandResult DisplayListPlayerSkia::fill_ellipse(FillEllipse const& command) { auto const& rect = command.rect; auto& canvas = surface().canvas(); @@ -667,7 +667,7 @@ CommandResult CommandExecutorSkia::fill_ellipse(FillEllipse const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_line(DrawLine const& command) +CommandResult DisplayListPlayerSkia::draw_line(DrawLine const& command) { auto from = SkPoint::Make(command.from.x(), command.from.y()); auto to = SkPoint::Make(command.to.x(), command.to.y()); @@ -679,7 +679,7 @@ CommandResult CommandExecutorSkia::draw_line(DrawLine const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::apply_backdrop_filter(ApplyBackdropFilter const& command) +CommandResult DisplayListPlayerSkia::apply_backdrop_filter(ApplyBackdropFilter const& command) { auto& canvas = surface().canvas(); @@ -817,7 +817,7 @@ CommandResult CommandExecutorSkia::apply_backdrop_filter(ApplyBackdropFilter con return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_rect(DrawRect const& command) +CommandResult DisplayListPlayerSkia::draw_rect(DrawRect const& command) { auto const& rect = command.rect; auto& canvas = surface().canvas(); @@ -829,7 +829,7 @@ CommandResult CommandExecutorSkia::draw_rect(DrawRect const& command) return CommandResult::Continue; } -CommandResult CommandExecutorSkia::paint_radial_gradient(PaintRadialGradient const& command) +CommandResult DisplayListPlayerSkia::paint_radial_gradient(PaintRadialGradient const& command) { APPLY_PATH_CLIP_IF_NEEDED @@ -859,22 +859,22 @@ CommandResult CommandExecutorSkia::paint_radial_gradient(PaintRadialGradient con return CommandResult::Continue; } -CommandResult CommandExecutorSkia::paint_conic_gradient(PaintConicGradient const& command) +CommandResult DisplayListPlayerSkia::paint_conic_gradient(PaintConicGradient const& command) { APPLY_PATH_CLIP_IF_NEEDED return CommandResult::Continue; } -CommandResult CommandExecutorSkia::draw_triangle_wave(DrawTriangleWave const&) +CommandResult DisplayListPlayerSkia::draw_triangle_wave(DrawTriangleWave const&) { return CommandResult::Continue; } -void CommandExecutorSkia::prepare_to_execute(size_t) +void DisplayListPlayerSkia::prepare_to_execute(size_t) { } -CommandResult CommandExecutorSkia::sample_under_corners(SampleUnderCorners const& command) +CommandResult DisplayListPlayerSkia::sample_under_corners(SampleUnderCorners const& command) { auto rounded_rect = to_skia_rrect(command.border_rect, command.corner_radii); auto& canvas = surface().canvas(); @@ -884,14 +884,14 @@ CommandResult CommandExecutorSkia::sample_under_corners(SampleUnderCorners const return CommandResult::Continue; } -CommandResult CommandExecutorSkia::blit_corner_clipping(BlitCornerClipping const&) +CommandResult DisplayListPlayerSkia::blit_corner_clipping(BlitCornerClipping const&) { auto& canvas = surface().canvas(); canvas.restore(); return CommandResult::Continue; } -bool CommandExecutorSkia::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const +bool DisplayListPlayerSkia::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const { return surface().canvas().quickReject(to_skia_rect(rect)); } diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.h similarity index 95% rename from Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h rename to Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.h index b1e14e251a2..5c859adf4e3 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorSkia.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.h @@ -11,7 +11,7 @@ namespace Web::Painting { -class CommandExecutorSkia : public CommandExecutor { +class DisplayListPlayerSkia : public DisplayListPlayer { public: CommandResult draw_glyph_run(DrawGlyphRun const&) override; CommandResult fill_rect(FillRect const&) override; @@ -52,8 +52,8 @@ public: bool needs_update_immutable_bitmap_texture_cache() const override { return false; } void update_immutable_bitmap_texture_cache(HashMap&) override {}; - CommandExecutorSkia(Gfx::Bitmap& bitmap); - virtual ~CommandExecutorSkia() override; + DisplayListPlayerSkia(Gfx::Bitmap& bitmap); + virtual ~DisplayListPlayerSkia() override; private: class SkiaSurface; diff --git a/Userland/Libraries/LibWeb/Painting/SVGMaskable.cpp b/Userland/Libraries/LibWeb/Painting/SVGMaskable.cpp index 75c4f665f6e..24b390f939b 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGMaskable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGMaskable.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -88,7 +88,7 @@ RefPtr SVGMaskable::calculate_mask_of_svg(PaintContext& context, CS paint_context.set_svg_transform(graphics_element.get_transform()); paint_context.set_draw_svg_geometry_for_clip_path(is(paintable)); StackingContext::paint_node_as_stacking_context(paintable, paint_context); - CommandExecutorCPU executor { *mask_bitmap }; + DisplayListPlayerCPU executor { *mask_bitmap }; display_list.execute(executor); return mask_bitmap; }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp index 52ede856b0a..917d2ffcc56 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp @@ -15,8 +15,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -98,16 +98,16 @@ RefPtr SVGDecodedImageData::render(Gfx::IntSize size) const m_document->navigable()->record_display_list(display_list_recorder, {}); - auto painting_command_executor_type = m_page_client->painting_command_executor_type(); + auto painting_command_executor_type = m_page_client->display_list_player_type(); switch (painting_command_executor_type) { - case PaintingCommandExecutorType::CPU: - case PaintingCommandExecutorType::GPU: { // GPU painter does not have any path rasterization support so we always fall back to CPU painter - Painting::CommandExecutorCPU executor { *bitmap }; + case DisplayListPlayerType::CPU: + case DisplayListPlayerType::GPU: { // GPU painter does not have any path rasterization support so we always fall back to CPU painter + Painting::DisplayListPlayerCPU executor { *bitmap }; display_list.execute(executor); break; } - case PaintingCommandExecutorType::Skia: { - Painting::CommandExecutorSkia executor { *bitmap }; + case DisplayListPlayerType::Skia: { + Painting::DisplayListPlayerSkia executor { *bitmap }; display_list.execute(executor); break; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h index c1514d59ac6..bd41f12516c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h @@ -80,7 +80,7 @@ public: virtual void schedule_repaint() override { } virtual bool is_ready_to_paint() const override { return true; } - virtual PaintingCommandExecutorType painting_command_executor_type() const override { return m_host_page->client().painting_command_executor_type(); } + virtual DisplayListPlayerType display_list_player_type() const override { return m_host_page->client().display_list_player_type(); } private: explicit SVGPageClient(Page& host_page) diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index a9dcb07141c..bb58ff4e461 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -26,7 +26,7 @@ #include #ifdef HAS_ACCELERATED_GRAPHICS -# include +# include #endif namespace WebContent { @@ -740,13 +740,13 @@ void PageClient::did_get_js_console_messages(i32 start_index, Vector client().async_did_get_js_console_messages(m_id, start_index, move(message_types), move(messages)); } -Web::PaintingCommandExecutorType PageClient::painting_command_executor_type() const +Web::DisplayListPlayerType PageClient::display_list_player_type() const { if (s_use_gpu_painter) - return Web::PaintingCommandExecutorType::GPU; + return Web::DisplayListPlayerType::GPU; if (s_use_skia_painter) - return Web::PaintingCommandExecutorType::Skia; - return Web::PaintingCommandExecutorType::CPU; + return Web::DisplayListPlayerType::Skia; + return Web::DisplayListPlayerType::CPU; } void PageClient::queue_screenshot_task(Optional node_id) diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index 24bdda8b81c..5e16a82846c 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -87,7 +87,7 @@ public: virtual double device_pixels_per_css_pixel() const override { return m_device_pixels_per_css_pixel; } - virtual Web::PaintingCommandExecutorType painting_command_executor_type() const override; + virtual Web::DisplayListPlayerType display_list_player_type() const override; void queue_screenshot_task(Optional node_id); diff --git a/Userland/Services/WebWorker/PageHost.h b/Userland/Services/WebWorker/PageHost.h index 78853909b5a..32336f75641 100644 --- a/Userland/Services/WebWorker/PageHost.h +++ b/Userland/Services/WebWorker/PageHost.h @@ -36,7 +36,7 @@ public: virtual void request_file(Web::FileRequest) override; virtual void schedule_repaint() override {}; virtual bool is_ready_to_paint() const override { return true; } - virtual Web::PaintingCommandExecutorType painting_command_executor_type() const override { VERIFY_NOT_REACHED(); } + virtual Web::DisplayListPlayerType display_list_player_type() const override { VERIFY_NOT_REACHED(); } private: explicit PageHost(ConnectionFromClient&);