LibWeb: Serialize external content surface clears

Lock the shared Skia backend context before clearing an external
content back store.

Nested navigables render through PublishToExternalContent, and that
clear ran outside the locking used by normal display list playback.
This allowed multiple renderer threads to enter the same Ganesh
context concurrently and trip Skia's SingleOwner checks during
painting.
This commit is contained in:
Andreas Kling
2026-04-12 12:44:18 +02:00
committed by Jelle Raaijmakers
parent 149ac3e674
commit ff5273084d
Notes: github-actions[bot] 2026-04-13 10:27:23 +00:00

View File

@@ -209,7 +209,9 @@ public:
if (should_clear_back_store) {
// Embedded navigables leave their PaintConfig canvas unfilled, so double-buffered back stores
// must be cleared before repainting.
m_backing_stores.back_store->lock_context();
m_backing_stores.back_store->canvas().clear(SK_ColorTRANSPARENT);
m_backing_stores.back_store->unlock_context();
}
m_skia_player->execute(*m_cached_display_list, m_cached_scroll_state_snapshot, *m_backing_stores.back_store);
i32 rendered_bitmap_id = m_backing_stores.back_bitmap_id;