14KHRSwapchainVK::KHRSwapchainVK(
const std::shared_ptr<Context>& context,
15 vk::UniqueSurfaceKHR surface,
18 : size_(
size), enable_msaa_(enable_msaa) {
19 auto impl = KHRSwapchainImplVK::Create(context,
24 if (!impl || !impl->IsValid()) {
28 impl_ = std::move(impl);
31KHRSwapchainVK::~KHRSwapchainVK() =
default;
33bool KHRSwapchainVK::IsValid()
const {
34 return impl_ ? impl_->IsValid() :
false;
37void KHRSwapchainVK::UpdateSurfaceSize(
const ISize& size) {
43void KHRSwapchainVK::AddFinalCommandBuffer(
44 std::shared_ptr<CommandBuffer> cmd_buffer)
const {
45 impl_->AddFinalCommandBuffer(std::move(cmd_buffer));
48std::unique_ptr<Surface> KHRSwapchainVK::AcquireNextDrawable() {
49 return AcquireNextDrawable(0u);
52std::unique_ptr<Surface> KHRSwapchainVK::AcquireNextDrawable(
53 size_t resize_retry_count) {
60 auto result = impl_->AcquireNextDrawable();
61 if (!result.out_of_date && size_ == impl_->GetSize()) {
62 return std::move(result.surface);
74 constexpr const size_t kMaxResizeAttempts = 3u;
75 if (resize_retry_count == kMaxResizeAttempts) {
76 VALIDATION_LOG <<
"Attempted to resize the swapchain" << kMaxResizeAttempts
77 <<
" time unsuccessfully. This platform likely doesn't "
78 "support returning the current swapchain extents and "
79 "must recreate the swapchain using the actual size.";
83 size_ = impl_->GetCurrentUnderlyingSurfaceSize().value_or(size_);
90 auto context = impl_->GetContext();
91 auto [
surface, old_swapchain] = impl_->DestroySwapchain();
93 auto new_impl = KHRSwapchainImplVK::Create(context,
99 if (!new_impl || !new_impl->IsValid()) {
106 impl_ = std::move(new_impl);
111 return AcquireNextDrawable(resize_retry_count + 1);
114vk::Format KHRSwapchainVK::GetSurfaceFormat()
const {
115 return IsValid() ? impl_->GetSurfaceFormat() : vk::Format::eUndefined;
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#define TRACE_EVENT0(category_group, name)