7 #include "flutter/fml/trace_event.h"
13 const std::shared_ptr<Context>& context,
14 vk::UniqueSurfaceKHR surface) {
16 if (!impl || !impl->IsValid()) {
19 return std::shared_ptr<SwapchainVK>(
new SwapchainVK(std::move(impl)));
22 SwapchainVK::SwapchainVK(std::shared_ptr<SwapchainImplVK> impl)
23 : impl_(
std::move(impl)) {}
28 return impl_ ? impl_->IsValid() :
false;
36 TRACE_EVENT0(
"impeller", __FUNCTION__);
38 auto result = impl_->AcquireNextDrawable();
39 if (!result.out_of_date) {
40 return std::move(result.surface);
43 TRACE_EVENT0(
"impeller",
"RecreateSwapchain");
47 auto context = impl_->GetContext();
48 auto [surface, old_swapchain] = impl_->DestroySwapchain();
53 impl_->GetLastTransform()
55 if (!new_impl || !new_impl->IsValid()) {
62 impl_ = std::move(new_impl);
71 return IsValid() ? impl_->GetSurfaceFormat() : vk::Format::eUndefined;