Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eedf60b

Browse files
committed
Lazily create the backingstore_producer vulkan context
1 parent 82e8c97 commit eedf60b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/embedder/tests/embedder_test_backingstore_producer.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ EmbedderTestBackingStoreProducer::EmbedderTestBackingStoreProducer(
2525
#endif
2626
#ifdef SHELL_ENABLE_VULKAN
2727
,
28-
test_vulkan_context_(fml::MakeRefCounted<TestVulkanContext>())
28+
test_vulkan_context_(nullptr)
2929
#endif
3030
{
3131
}
@@ -241,6 +241,10 @@ bool EmbedderTestBackingStoreProducer::CreateVulkanImage(
241241
const FlutterBackingStoreConfig* config,
242242
FlutterBackingStore* backing_store_out) {
243243
#ifdef SHELL_ENABLE_VULKAN
244+
if (!test_vulkan_context_) {
245+
test_vulkan_context_ = fml::MakeRefCounted<TestVulkanContext>();
246+
}
247+
244248
auto surface_size = SkISize::Make(config->size.width, config->size.height);
245249
TestVulkanImage* test_image = new TestVulkanImage(
246250
std::move(test_vulkan_context_->CreateImage(surface_size).value()));

0 commit comments

Comments
 (0)