LibWeb: Do not create Metal context when Skia painter is not enabled

This commit is contained in:
Aliaksandr Kalenik 2024-07-04 23:57:00 +02:00 committed by Andreas Kling
parent ae983a2ef7
commit 70db2bff92
Notes: sideshowbarker 2024-07-17 16:23:55 +09:00

View file

@ -29,8 +29,11 @@ TraversableNavigable::TraversableNavigable(JS::NonnullGCPtr<Page> page)
, m_session_history_traversal_queue(vm().heap().allocate_without_realm<SessionHistoryTraversalQueue>())
{
#ifdef AK_OS_MACOS
m_metal_context = Core::get_metal_context();
m_skia_backend_context = Painting::DisplayListPlayerSkia::create_metal_context(*m_metal_context);
auto display_list_player_type = page->client().display_list_player_type();
if (display_list_player_type == DisplayListPlayerType::Skia) {
m_metal_context = Core::get_metal_context();
m_skia_backend_context = Painting::DisplayListPlayerSkia::create_metal_context(*m_metal_context);
}
#endif
}