52 :
public std::enable_shared_from_this<AHBSwapchainImplVK> {
72 static std::shared_ptr<AHBSwapchainImplVK>
Create(
73 const std::weak_ptr<Context>&
context,
74 std::weak_ptr<android::SurfaceControl> surface_control,
117 using AutoSemaSignaler = std::shared_ptr<fml::ScopedCleanupClosure>;
119 std::weak_ptr<android::SurfaceControl> surface_control_;
121 std::shared_ptr<AHBTexturePoolVK> pool_;
122 std::shared_ptr<SwapchainTransientsVK> transients_;
126 Mutex currently_displayed_texture_mutex_;
127 std::shared_ptr<AHBTextureSourceVK> currently_displayed_texture_
130 std::vector<std::unique_ptr<AHBFrameSynchronizerVK>> frame_data_;
131 size_t frame_index_ = 0;
133 bool is_valid_ =
false;
136 const std::weak_ptr<Context>&
context,
137 std::weak_ptr<android::SurfaceControl> surface_control,
142 bool Present(
const std::shared_ptr<AHBTextureSourceVK>&
texture);
144 void WaitIdle()
const;
146 vk::UniqueSemaphore CreateRenderReadySemaphore(
147 const std::shared_ptr<fml::UniqueFD>& fd)
const;
149 bool ImportRenderReady(
150 const std::shared_ptr<fml::UniqueFD>& render_ready_fence,
151 const std::shared_ptr<AHBTextureSourceVK>&
texture);
153 std::shared_ptr<ExternalSemaphoreVK> SubmitSignalForPresentReady(
154 const std::shared_ptr<AHBTextureSourceVK>&
texture)
const;
156 void OnTextureUpdatedOnSurfaceControl(
157 std::shared_ptr<AHBTextureSourceVK>
texture,
158 ASurfaceTransactionStats* stats);
static std::shared_ptr< AHBSwapchainImplVK > Create(const std::weak_ptr< Context > &context, std::weak_ptr< android::SurfaceControl > surface_control, const CreateTransactionCB &cb, const ISize &size, bool enable_msaa)
Create a swapchain of a specific size whose images will be presented to the provided surface control.