From d9bf6d5b8e9b3378729b34882571e12e8e8ceb8f Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 14 Nov 2024 09:00:19 -0800 Subject: [PATCH] Move Vulkan context to EmbedderTestContextVulkan (flutter/engine#56571) In flutter/engine#29391 we extracted EmbedderTestContextVulkan, but didn't move the vulkan_context_ to that class. Since it's no longer used in the base class, we push it down to avoid the ifdef guards. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../shell/platform/embedder/tests/embedder_test_context.h | 6 ------ .../platform/embedder/tests/embedder_test_context_vulkan.h | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context.h b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context.h index b99d6b35342..eb0deb4b767 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context.h +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context.h @@ -116,12 +116,6 @@ class EmbedderTestContext { using NextSceneCallback = std::function image)>; -#ifdef SHELL_ENABLE_VULKAN - // The TestVulkanContext destructor must be called _after_ the compositor is - // freed. - fml::RefPtr vulkan_context_ = nullptr; -#endif - #ifdef SHELL_ENABLE_GL std::shared_ptr egl_context_ = nullptr; #endif diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_vulkan.h b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_vulkan.h index e7eb6906d9d..18cceab4a28 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_vulkan.h +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_vulkan.h @@ -38,6 +38,10 @@ class EmbedderTestContextVulkan : public EmbedderTestContext { const char* name); private: + // The TestVulkanContext destructor must be called _after_ the compositor is + // freed. + fml::RefPtr vulkan_context_ = nullptr; + std::unique_ptr surface_; SkISize surface_size_ = SkISize::MakeEmpty();