5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_SWAPCHAIN_IMPL_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_SWAPCHAIN_IMPL_VK_H_
10 #include "flutter/fml/closure.h"
11 #include "flutter/fml/synchronization/semaphore.h"
30 :
public std::enable_shared_from_this<AHBSwapchainImplVK> {
50 static std::shared_ptr<AHBSwapchainImplVK>
Create(
51 const std::weak_ptr<Context>& context,
52 std::weak_ptr<android::SurfaceControl> surface_control,
55 size_t swapchain_image_count);
93 using AutoSemaSignaler = std::shared_ptr<fml::ScopedCleanupClosure>;
95 std::weak_ptr<android::SurfaceControl> surface_control_;
97 std::shared_ptr<AHBTexturePoolVK> pool_;
98 std::shared_ptr<SwapchainTransientsVK> transients_;
101 Mutex currently_displayed_texture_mutex_;
102 std::shared_ptr<AHBTextureSourceVK> currently_displayed_texture_
103 IPLR_GUARDED_BY(currently_displayed_texture_mutex_);
104 std::shared_ptr<fml::Semaphore> pending_presents_;
105 bool is_valid_ =
false;
108 const std::weak_ptr<Context>& context,
109 std::weak_ptr<android::SurfaceControl> surface_control,
112 size_t swapchain_image_count);
114 bool Present(
const AutoSemaSignaler& signaler,
115 const std::shared_ptr<AHBTextureSourceVK>& texture);
117 vk::UniqueFence CreateRenderReadyFence(
118 const std::shared_ptr<fml::UniqueFD>& fd)
const;
120 bool SubmitWaitForRenderReady(
121 const std::shared_ptr<fml::UniqueFD>& render_ready_fence,
122 const std::shared_ptr<AHBTextureSourceVK>& texture)
const;
124 std::shared_ptr<ExternalFenceVK> SubmitSignalForPresentReady(
125 const std::shared_ptr<AHBTextureSourceVK>& texture)
const;
127 void OnTextureUpdatedOnSurfaceControl(
128 const AutoSemaSignaler& signaler,
129 std::shared_ptr<AHBTextureSourceVK> texture,
130 ASurfaceTransactionStats* stats);
135 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_SWAPCHAIN_IMPL_VK_H_