5#include "flutter/testing/testing.h"
14TEST(CommandPoolRecyclerVKTest, GetsACommandPoolPerThread) {
23 std::shared_ptr<CommandPoolVK> pool1;
24 std::shared_ptr<CommandPoolVK> pool2;
28 [&]() { pool1 = context->GetCommandPoolRecycler()->
Get(); });
31 [&]() { pool2 = context->GetCommandPoolRecycler()->
Get(); });
37 EXPECT_NE(pool1, pool2);
43TEST(CommandPoolRecyclerVKTest, GetsTheSameCommandPoolOnSameThread) {
46 auto const pool1 = context->GetCommandPoolRecycler()->Get();
47 auto const pool2 = context->GetCommandPoolRecycler()->Get();
50 EXPECT_EQ(pool1.get(), pool2.get());
60class DeathRattle final {
65 DeathRattle(DeathRattle&&) =
default;
66 DeathRattle& operator=(DeathRattle&&) =
default;
68 ~DeathRattle() { callback_(); }
76TEST(CommandPoolRecyclerVKTest, ReclaimMakesCommandPoolAvailable) {
81 auto const recycler = context->GetCommandPoolRecycler();
82 auto const pool = recycler->Get();
92 auto rattle = DeathRattle([&waiter]() { waiter.Signal(); });
100 std::thread thread([&]() {
101 auto const pool = context->GetCommandPoolRecycler()->
Get();
102 EXPECT_NE(
pool.get(),
nullptr);
109 EXPECT_EQ(
std::count(called->begin(), called->end(),
"vkCreateCommandPool"),
115TEST(CommandPoolRecyclerVKTest, CommandBuffersAreRecycled) {
120 auto const recycler = context->GetCommandPoolRecycler();
121 auto pool = recycler->Get();
124 pool->CollectCommandBuffer(std::move(
buffer));
131 for (
auto i = 0u;
i < 2u;
i++) {
133 auto rattle = DeathRattle([&waiter]() { waiter.Signal(); });
144 auto const recycler = context->GetCommandPoolRecycler();
145 auto pool = recycler->Get();
148 pool->CollectCommandBuffer(std::move(
buffer));
156 EXPECT_EQ(
std::count(called->begin(), called->end(),
"vkCreateCommandPool"),
159 std::count(called->begin(), called->end(),
"vkAllocateCommandBuffers"),
static SkString resource(SkPDFResourceType type, int index)
A unique handle to a resource which will be reclaimed by the specified resource manager.
std::shared_ptr< ContextVK > Build()
Create a Vulkan context with Vulkan functions mocked. The caller is given a chance to tinker on the s...
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function
const GrXPFactory * Get(SkBlendMode mode)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
std::shared_ptr< std::vector< std::string > > GetMockVulkanFunctions(VkDevice device)
TEST(AiksCanvasTest, EmptyCullRect)