mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
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:
parent
082053d781
commit
c18314b942
Notes:
github-actions[bot]
2025-07-04 14:14:05 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: c18314b942
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5259
Reviewed-by: https://github.com/gmta ✅
14 changed files with 52 additions and 189 deletions
|
@ -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(), [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue