mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 07:07:49 +00:00
Ladybird+LibWeb+WebContent: Always use Skia CPU backend in tests mode
Enforce the use of the CPU backend in test mode to ensure that ref-tests produce consistent results across different computers, as this consistency cannot be achieved with the GPU backend.
This commit is contained in:
parent
9fb44cb057
commit
3ddacaa705
Notes:
sideshowbarker
2024-07-18 02:44:45 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 3ddacaa705
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/680
6 changed files with 42 additions and 15 deletions
|
@ -27,13 +27,13 @@
|
|||
|
||||
namespace WebContent {
|
||||
|
||||
static bool s_use_skia_painter = false;
|
||||
static PageClient::UseSkiaPainter s_use_skia_painter = PageClient::UseSkiaPainter::No;
|
||||
|
||||
JS_DEFINE_ALLOCATOR(PageClient);
|
||||
|
||||
void PageClient::set_use_skia_painter()
|
||||
void PageClient::set_use_skia_painter(UseSkiaPainter use_skia_painter)
|
||||
{
|
||||
s_use_skia_painter = true;
|
||||
s_use_skia_painter = use_skia_painter;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<PageClient> PageClient::create(JS::VM& vm, PageHost& page_host, u64 id)
|
||||
|
@ -732,9 +732,16 @@ void PageClient::did_get_js_console_messages(i32 start_index, Vector<ByteString>
|
|||
|
||||
Web::DisplayListPlayerType PageClient::display_list_player_type() const
|
||||
{
|
||||
if (s_use_skia_painter)
|
||||
return Web::DisplayListPlayerType::Skia;
|
||||
return Web::DisplayListPlayerType::CPU;
|
||||
switch (s_use_skia_painter) {
|
||||
case UseSkiaPainter::No:
|
||||
return Web::DisplayListPlayerType::CPU;
|
||||
case UseSkiaPainter::GPUBackendIfAvailable:
|
||||
return Web::DisplayListPlayerType::SkiaGPUIfAvailable;
|
||||
case UseSkiaPainter::CPUBackend:
|
||||
return Web::DisplayListPlayerType::SkiaCPU;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
void PageClient::queue_screenshot_task(Optional<i32> node_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue