mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
I started using `CreateMockVulkanContext()` in https://github.com/flutter/engine/pull/45654, and discovered that it was not thread-safe. This PR does a little bit of refactoring/TLC to ensure that functions and buffers can be accessed across threads (like the _real_ `ContextVK`). The attached test (_test for a test fixture, hoorah!_) fails consistently before the changes, and passes after. Note that if you try testing this with `--gtest_repeat=10000` (at least that's the threshold for me), it'll fail - that's actually due to https://github.com/flutter/flutter/issues/134482 which in turn is being fixed in https://github.com/flutter/engine/pull/45686. (Unblocks https://github.com/flutter/flutter/issues/133198) --------- Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>