LibWeb+LibGfx: Replace BackingStore with PaintingSurface

Now, when Skia backend context is available by the time backing stores
are allocated, there is no need to have a separate BackingStore class.

This allows us to get rid of BackingStore -> PaintingSurface cache.
This commit is contained in:
Aliaksandr Kalenik 2025-06-27 04:39:16 +02:00 committed by Jelle Raaijmakers
commit c18314b942
Notes: github-actions[bot] 2025-07-04 14:14:05 +00:00
14 changed files with 52 additions and 189 deletions

View file

@ -13,7 +13,6 @@
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Namespace.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/Painting/BackingStore.h>
#include <LibWeb/WebDriver/Screenshot.h>
namespace Web::WebDriver {
@ -56,10 +55,10 @@ ErrorOr<GC::Ref<HTML::HTMLCanvasElement>, WebDriver::Error> draw_bounding_box_fr
Gfx::IntRect paint_rect { rect.x(), rect.y(), paint_width, paint_height };
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::AlphaType::Premultiplied, canvas.surface()->size()));
auto backing_store = Painting::BitmapBackingStore::create(bitmap);
auto painting_surface = Gfx::PaintingSurface::wrap_bitmap(bitmap);
IGNORE_USE_IN_ESCAPING_LAMBDA bool did_paint = false;
HTML::PaintConfig paint_config { .canvas_fill_rect = paint_rect };
browsing_context.active_document()->navigable()->start_display_list_rendering(backing_store, paint_config, [&did_paint] {
browsing_context.active_document()->navigable()->start_display_list_rendering(painting_surface, paint_config, [&did_paint] {
did_paint = true;
});
HTML::main_thread_event_loop().spin_until(GC::create_function(HTML::main_thread_event_loop().heap(), [&] {