LibWeb+WebContent+WebWorker: Move backing store allocation in Navigable

Making navigables responsible for backing store allocation will allow us
to have separate backing stores for iframes and run paint updates for
them independently, which is a step toward isolating them into separate
processes.

Another nice side effect is that now Skia backend context is ready by
the time backing stores are allocated, so we will be able to get rid of
BackingStore class in the upcoming changes and allocate PaintingSurface
directly.
This commit is contained in:
Aliaksandr Kalenik 2025-06-26 22:33:58 +02:00 committed by Jelle Raaijmakers
commit 082053d781
Notes: github-actions[bot] 2025-07-04 14:14:12 +00:00
23 changed files with 265 additions and 262 deletions

View file

@ -301,16 +301,6 @@ private:
bool m_listen_for_dom_mutations { false };
};
struct PaintOptions {
enum class PaintOverlay {
No,
Yes,
};
PaintOverlay paint_overlay { PaintOverlay::Yes };
bool should_show_line_box_borders { false };
};
enum class DisplayListPlayerType {
SkiaGPUIfAvailable,
SkiaCPU,
@ -320,6 +310,7 @@ class PageClient : public JS::Cell {
GC_CELL(PageClient, JS::Cell);
public:
virtual u64 id() const = 0;
virtual Page& page() = 0;
virtual Page const& page() const = 0;
virtual bool is_connection_open() const = 0;
@ -331,9 +322,6 @@ public:
virtual CSS::PreferredColorScheme preferred_color_scheme() const = 0;
virtual CSS::PreferredContrast preferred_contrast() const = 0;
virtual CSS::PreferredMotion preferred_motion() const = 0;
virtual void paint_next_frame() = 0;
virtual void process_screenshot_requests() = 0;
virtual void start_display_list_rendering(DevicePixelRect const&, Painting::BackingStore&, PaintOptions, Function<void()>&& callback) = 0;
virtual Queue<QueuedInputEvent>& input_event_queue() = 0;
virtual void report_finished_handling_input_event(u64 page_id, EventResult event_was_handled) = 0;
virtual void page_did_change_title(ByteString const&) { }
@ -415,9 +403,10 @@ public:
virtual void page_did_mutate_dom([[maybe_unused]] FlyString const& type, [[maybe_unused]] DOM::Node const& target, [[maybe_unused]] DOM::NodeList& added_nodes, [[maybe_unused]] DOM::NodeList& removed_nodes, [[maybe_unused]] GC::Ptr<DOM::Node> previous_sibling, [[maybe_unused]] GC::Ptr<DOM::Node> next_sibling, [[maybe_unused]] Optional<String> const& attribute_name) { }
virtual void received_message_from_web_ui([[maybe_unused]] String const& name, [[maybe_unused]] JS::Value data) { }
virtual void page_did_paint([[maybe_unused]] Gfx::IntRect const& content_rect, [[maybe_unused]] i32 bitmap_id) { }
virtual void page_did_take_screenshot(Gfx::ShareableBitmap const&) { }
virtual bool is_ready_to_paint() const = 0;
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;