5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMPL_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMPL_VK_H_
19 class KHRSwapchainImageVK;
21 struct KHRFrameSynchronizerVK;
32 :
public std::enable_shared_from_this<KHRSwapchainImplVK> {
34 static std::shared_ptr<KHRSwapchainImplVK>
Create(
35 const std::shared_ptr<Context>& context,
36 vk::UniqueSurfaceKHR surface,
38 bool enable_msaa =
true,
39 vk::SwapchainKHR old_swapchain = VK_NULL_HANDLE);
67 std::weak_ptr<Context> context_;
68 vk::UniqueSurfaceKHR surface_;
69 vk::Format surface_format_ = vk::Format::eUndefined;
70 vk::UniqueSwapchainKHR swapchain_;
71 std::shared_ptr<SwapchainTransientsVK> transients_;
72 std::vector<std::shared_ptr<KHRSwapchainImageVK>> images_;
73 std::vector<std::unique_ptr<KHRFrameSynchronizerVK>> synchronizers_;
74 size_t current_frame_ = 0u;
76 bool enable_msaa_ =
true;
77 bool is_valid_ =
false;
80 vk::UniqueSurfaceKHR surface,
83 vk::SwapchainKHR old_swapchain);
85 bool Present(
const std::shared_ptr<KHRSwapchainImageVK>& image,
88 void WaitIdle()
const;
97 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMPL_VK_H_