/* * Copyright (c) 2025-2026, Aliaksandr Kalenik * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include namespace Web::HTML { class RenderingThread { AK_MAKE_NONCOPYABLE(RenderingThread); AK_MAKE_NONMOVABLE(RenderingThread); class ThreadData; public: using PresentationCallback = Function; struct PresentToUI { }; struct PublishToExternalContent { NonnullRefPtr source; }; using PresentationMode = Variant; explicit RenderingThread(PresentationCallback); ~RenderingThread(); void start(DisplayListPlayerType); void set_skia_player(OwnPtr&& player); void set_presentation_mode(PresentationMode); void update_display_list(NonnullRefPtr, Painting::ScrollStateSnapshot&&); void update_backing_stores(RefPtr front, RefPtr back, i32 front_id, i32 back_id); u64 present_frame(Gfx::IntRect); void wait_for_frame(u64 frame_id); void request_screenshot(NonnullRefPtr, Function&& callback); void ready_to_paint(); private: NonnullRefPtr m_thread_data; RefPtr m_thread; }; }