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_
14 #include "vulkan/vulkan_enums.hpp"
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::vector<std::shared_ptr<KHRSwapchainImageVK>> images_;
72 std::vector<std::unique_ptr<KHRFrameSynchronizerVK>> synchronizers_;
73 size_t current_frame_ = 0u;
75 bool enable_msaa_ =
true;
76 bool is_valid_ =
false;
79 vk::UniqueSurfaceKHR surface,
82 vk::SwapchainKHR old_swapchain);
84 bool Present(
const std::shared_ptr<KHRSwapchainImageVK>& image,
87 void WaitIdle()
const;
96 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMPL_VK_H_