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_
18 class KHRSwapchainImageVK;
20 struct KHRFrameSynchronizerVK;
31 :
public std::enable_shared_from_this<KHRSwapchainImplVK> {
33 static std::shared_ptr<KHRSwapchainImplVK>
Create(
34 const std::shared_ptr<Context>& context,
35 vk::UniqueSurfaceKHR surface,
37 bool enable_msaa =
true,
38 vk::SwapchainKHR old_swapchain = VK_NULL_HANDLE);
70 std::weak_ptr<Context> context_;
71 vk::UniqueSurfaceKHR surface_;
72 vk::Format surface_format_ = vk::Format::eUndefined;
73 vk::UniqueSwapchainKHR swapchain_;
74 std::shared_ptr<SwapchainTransientsVK> transients_;
75 std::vector<std::shared_ptr<KHRSwapchainImageVK>> images_;
76 std::vector<std::unique_ptr<KHRFrameSynchronizerVK>> synchronizers_;
77 size_t current_frame_ = 0u;
79 bool enable_msaa_ =
true;
80 bool is_valid_ =
false;
83 vk::UniqueSurfaceKHR surface,
86 vk::SwapchainKHR old_swapchain);
88 bool Present(
const std::shared_ptr<KHRSwapchainImageVK>& image,
91 void WaitIdle()
const;
An instance of a swapchain that does NOT adapt to going out of date with the underlying surface....
std::shared_ptr< Context > GetContext() const
void AddFinalCommandBuffer(std::shared_ptr< CommandBuffer > cmd_buffer)
static std::shared_ptr< KHRSwapchainImplVK > Create(const std::shared_ptr< Context > &context, vk::UniqueSurfaceKHR surface, const ISize &size, bool enable_msaa=true, vk::SwapchainKHR old_swapchain=VK_NULL_HANDLE)
AcquireResult AcquireNextDrawable()
vk::Format GetSurfaceFormat() const
std::optional< ISize > GetCurrentUnderlyingSurfaceSize() const
std::pair< vk::UniqueSurfaceKHR, vk::UniqueSwapchainKHR > DestroySwapchain()
const ISize & GetSize() const
AcquireResult(std::unique_ptr< Surface > p_surface)
std::unique_ptr< Surface > surface
AcquireResult(bool p_out_of_date=false)