7 #include "flutter/fml/trace_event.h"
14 const std::shared_ptr<Context>& context,
15 vk::UniqueSurfaceKHR surface) {
17 if (!impl || !impl->IsValid()) {
21 return std::shared_ptr<SwapchainVK>(
new SwapchainVK(std::move(impl)));
24 SwapchainVK::SwapchainVK(std::shared_ptr<SwapchainImplVK> impl)
25 : impl_(
std::move(impl)) {}
30 return impl_ ? impl_->IsValid() :
false;
38 TRACE_EVENT0(
"impeller", __FUNCTION__);
40 auto result = impl_->AcquireNextDrawable();
41 if (!result.out_of_date) {
42 return std::move(result.surface);
45 TRACE_EVENT0(
"impeller",
"RecreateSwapchain");
49 auto context = impl_->GetContext();
50 auto [surface, old_swapchain] = impl_->DestroySwapchain();
55 impl_->GetLastTransform()
57 if (!new_impl || !new_impl->IsValid()) {
64 impl_ = std::move(new_impl);
73 return IsValid() ? impl_->GetSurfaceFormat() : vk::Format::eUndefined;