LibWeb+WebContent+WebWorker: Drop display list player type selection
WebContent no longer chooses between CPU and GPU display list players, and the remaining callers always use Skia raster playback. Remove the PageClient virtual and now-single-value enum, then play SVG image and cursor display lists directly.
This commit is contained in:
parent
40d446d558
commit
23885e7b4d
9 changed files with 7 additions and 57 deletions
|
|
@ -114,16 +114,10 @@ Optional<Gfx::ImageCursor> CursorStyleValue::make_image_cursor(Layout::NodeWithS
|
|||
image.resolve_for_size(layout_node, CSSPixelSize { bitmap.size() });
|
||||
image.paint(paint_context, document, DevicePixelRect { bitmap.rect() }, ImageRendering::Auto);
|
||||
|
||||
switch (document.page().client().display_list_player_type()) {
|
||||
case DisplayListPlayerType::SkiaGPUIfAvailable:
|
||||
case DisplayListPlayerType::SkiaCPU: {
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_bitmap(bitmap);
|
||||
Painting::DisplayListPlayerSkia display_list_player;
|
||||
display_list_player.execute(*display_list, visual_context_tree, resource_storage, {}, painting_surface);
|
||||
display_list_player.flush(*painting_surface);
|
||||
break;
|
||||
}
|
||||
}
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_bitmap(bitmap);
|
||||
Painting::DisplayListPlayerSkia display_list_player;
|
||||
display_list_player.execute(*display_list, visual_context_tree, resource_storage, {}, painting_surface);
|
||||
display_list_player.flush(*painting_surface);
|
||||
}
|
||||
|
||||
// "If the values are unspecified, then the natural hotspot defined inside the image resource itself is used.
|
||||
|
|
|
|||
|
|
@ -403,11 +403,6 @@ private:
|
|||
bool m_processing_fullscreen_operations { false };
|
||||
};
|
||||
|
||||
enum class DisplayListPlayerType {
|
||||
SkiaGPUIfAvailable,
|
||||
SkiaCPU,
|
||||
};
|
||||
|
||||
enum class ContextMenuForInputEventsTarget : u8 {
|
||||
No,
|
||||
Yes,
|
||||
|
|
@ -566,8 +561,6 @@ public:
|
|||
|
||||
virtual void received_message_from_web_ui([[maybe_unused]] String const& name, [[maybe_unused]] JS::Value data) { }
|
||||
|
||||
virtual DisplayListPlayerType display_list_player_type() const = 0;
|
||||
|
||||
virtual bool is_headless() const = 0;
|
||||
|
||||
virtual bool is_svg_page_client() const { return false; }
|
||||
|
|
|
|||
|
|
@ -213,17 +213,9 @@ RefPtr<Gfx::PaintingSurface> SVGDecodedImageData::render_to_surface(Gfx::IntSize
|
|||
if (!display_list.has_value())
|
||||
return nullptr;
|
||||
|
||||
switch (m_page_client->display_list_player_type()) {
|
||||
case DisplayListPlayerType::SkiaGPUIfAvailable:
|
||||
case DisplayListPlayerType::SkiaCPU: {
|
||||
Painting::DisplayListPlayerSkia display_list_player;
|
||||
display_list_player.execute(*display_list->display_list, display_list->visual_context_tree, resource_storage, {}, surface);
|
||||
display_list_player.flush(*surface);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
Painting::DisplayListPlayerSkia display_list_player;
|
||||
display_list_player.execute(*display_list->display_list, display_list->visual_context_tree, resource_storage, {}, surface);
|
||||
display_list_player.flush(*surface);
|
||||
|
||||
m_cached_rendered_surfaces.set(size, *surface);
|
||||
return surface;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public:
|
|||
virtual void report_finished_handling_input_event([[maybe_unused]] u64 page_id, [[maybe_unused]] EventResult event_was_handled) override { }
|
||||
virtual void request_frame() override { }
|
||||
|
||||
virtual DisplayListPlayerType display_list_player_type() const override { return m_host_page->client().display_list_player_type(); }
|
||||
virtual bool is_headless() const override { return m_host_page->client().is_headless(); }
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
|
||||
namespace WebContent {
|
||||
|
||||
static PageClient::UseSkiaPainter s_use_skia_painter = PageClient::UseSkiaPainter::GPUBackendIfAvailable;
|
||||
static bool s_is_headless { false };
|
||||
static bool s_async_scrolling_enabled { false };
|
||||
static bool s_should_report_session_history_updates_in_test_mode { false };
|
||||
|
|
@ -68,11 +67,6 @@ static String serialize_dom_mutation_target(Web::DOM::Node const& target)
|
|||
return MUST(builder.to_string());
|
||||
}
|
||||
|
||||
void PageClient::set_use_skia_painter(UseSkiaPainter use_skia_painter)
|
||||
{
|
||||
s_use_skia_painter = use_skia_painter;
|
||||
}
|
||||
|
||||
bool PageClient::is_headless() const
|
||||
{
|
||||
return s_is_headless;
|
||||
|
|
@ -1235,18 +1229,6 @@ Vector<Web::CSS::StyleSheetIdentifier> PageClient::list_style_sheets() const
|
|||
return results;
|
||||
}
|
||||
|
||||
Web::DisplayListPlayerType PageClient::display_list_player_type() const
|
||||
{
|
||||
switch (s_use_skia_painter) {
|
||||
case UseSkiaPainter::GPUBackendIfAvailable:
|
||||
return Web::DisplayListPlayerType::SkiaGPUIfAvailable;
|
||||
case UseSkiaPainter::CPUBackend:
|
||||
return Web::DisplayListPlayerType::SkiaCPU;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
void PageClient::ensure_compositor_host()
|
||||
{
|
||||
m_owner.ensure_compositor_host();
|
||||
|
|
|
|||
|
|
@ -37,12 +37,6 @@ public:
|
|||
|
||||
virtual u64 id() const override { return m_id; }
|
||||
|
||||
enum class UseSkiaPainter {
|
||||
CPUBackend,
|
||||
GPUBackendIfAvailable,
|
||||
};
|
||||
static void set_use_skia_painter(UseSkiaPainter);
|
||||
|
||||
virtual bool is_headless() const override;
|
||||
static void set_is_headless(bool);
|
||||
|
||||
|
|
@ -122,7 +116,6 @@ public:
|
|||
virtual double device_pixel_ratio() const override { return m_device_pixel_ratio; }
|
||||
virtual double device_pixels_per_css_pixel() const override { return m_device_pixel_ratio * m_zoom_level; }
|
||||
|
||||
virtual Web::DisplayListPlayerType display_list_player_type() const override;
|
||||
virtual bool supports_compositor() const override { return true; }
|
||||
virtual void ensure_compositor_host() override;
|
||||
virtual Web::Compositor::CompositorHost* compositor_host() override;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ public:
|
|||
virtual void request_file(Web::FileRequest) override;
|
||||
virtual Web::HTML::WorkerAgentId start_worker_agent(Web::HTML::WorkerAgentStartRequest&&) override;
|
||||
virtual void close_worker_agent(Web::HTML::WorkerAgentId, Web::HTML::WorkerAgentOwnerToken) override;
|
||||
virtual Web::DisplayListPlayerType display_list_player_type() const override { VERIFY_NOT_REACHED(); }
|
||||
virtual bool is_headless() const override { VERIFY_NOT_REACHED(); }
|
||||
virtual Queue<Web::QueuedInputEvent>& input_event_queue() override { VERIFY_NOT_REACHED(); }
|
||||
virtual void report_finished_handling_input_event([[maybe_unused]] u64 page_id, [[maybe_unused]] Web::EventResult event_was_handled) override { VERIFY_NOT_REACHED(); }
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public:
|
|||
virtual void report_finished_handling_input_event(u64, Web::EventResult) override { }
|
||||
virtual void request_frame() override { }
|
||||
virtual void request_file(Web::FileRequest) override { }
|
||||
virtual Web::DisplayListPlayerType display_list_player_type() const override { return Web::DisplayListPlayerType::SkiaCPU; }
|
||||
virtual bool is_headless() const override { return true; }
|
||||
virtual void visit_edges(Visitor& visitor) override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ public:
|
|||
virtual void report_finished_handling_input_event([[maybe_unused]] u64 page_id, [[maybe_unused]] Web::EventResult event_was_handled) override { }
|
||||
virtual void request_frame() override { }
|
||||
virtual void request_file(Web::FileRequest) override { }
|
||||
virtual Web::DisplayListPlayerType display_list_player_type() const override { return Web::DisplayListPlayerType::SkiaCPU; }
|
||||
virtual bool is_headless() const override { return true; }
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in a new issue