mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibGfx+LibWeb: Move Skia backend context to process level singleton
Previously, this was attached to the traversable navigable. Using a singleton instead allows us to use the context for detached documents.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
d4cf537d58
commit
26389363ad
Notes:
github-actions[bot]
2026-03-19 12:36:24 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/26389363ad2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8460 Reviewed-by: https://github.com/gmta ✅
@@ -15,6 +15,7 @@
|
||||
#include <LibCrypto/OpenSSLForward.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/PathFontProvider.h>
|
||||
#include <LibGfx/SkiaBackendContext.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <LibIPC/TransportHandle.h>
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
@@ -198,7 +199,12 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
|
||||
Web::set_browser_process_executable_path(executable_path);
|
||||
|
||||
// Always use the CPU backend for tests, as the GPU backend is not deterministic
|
||||
WebContent::PageClient::set_use_skia_painter(force_cpu_painting ? WebContent::PageClient::UseSkiaPainter::CPUBackend : WebContent::PageClient::UseSkiaPainter::GPUBackendIfAvailable);
|
||||
if (force_cpu_painting) {
|
||||
WebContent::PageClient::set_use_skia_painter(WebContent::PageClient::UseSkiaPainter::CPUBackend);
|
||||
} else {
|
||||
Gfx::SkiaBackendContext::initialize_gpu_backend();
|
||||
WebContent::PageClient::set_use_skia_painter(WebContent::PageClient::UseSkiaPainter::GPUBackendIfAvailable);
|
||||
}
|
||||
|
||||
WebContent::PageClient::set_is_headless(is_headless);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user