Matan Lurey 0a8b89af42 [Impeller] Make CreateMockVulkanContext() thread-safe (flutter/engine#45687)
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>
2023-09-12 09:43:53 -07:00
..