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

View File

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