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

@ -58,7 +58,8 @@ ErrorOr<GC::Ref<HTML::HTMLCanvasElement>, WebDriver::Error> draw_bounding_box_fr
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::AlphaType::Premultiplied, canvas.surface()->size()));
auto backing_store = Painting::BitmapBackingStore::create(bitmap);
IGNORE_USE_IN_ESCAPING_LAMBDA bool did_paint = false;
browsing_context.page().client().start_display_list_rendering(paint_rect.to_type<Web::DevicePixels>(), backing_store, {}, [&did_paint] {
HTML::PaintConfig paint_config { .canvas_fill_rect = paint_rect };
browsing_context.active_document()->navigable()->start_display_list_rendering(backing_store, paint_config, [&did_paint] {
did_paint = true;
});
HTML::main_thread_event_loop().spin_until(GC::create_function(HTML::main_thread_event_loop().heap(), [&] {