| Flutter Impeller |

swapchain_vk.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include <memory>
8
9 #include "flutter/fml/macros.h"
10 #include "impeller/renderer/backend/vulkan/vk.h"
11 #include "impeller/renderer/context.h"
12 #include "impeller/renderer/surface.h"
13
14 namespace impeller {
15
16 class SwapchainImplVK;
17
18 //------------------------------------------------------------------------------
19 /// @brief A swapchain that adapts to the underlying surface going out of
20 /// date. If the caller cannot acquire the next drawable, it is due
21 /// to an unrecoverable error and the swapchain must be recreated
22 /// with a new surface.
23 ///
24 class SwapchainVK {
25 public:
26 static std::shared_ptr<SwapchainVK> Create(
27 const std::shared_ptr<Context>& context,
28 vk::UniqueSurfaceKHR surface);
29
30 ~SwapchainVK();
31
32 bool IsValid() const;
33
34 std::unique_ptr<Surface> AcquireNextDrawable();
35
36 vk::Format GetSurfaceFormat() const;
37
38 private:
39 std::shared_ptr<SwapchainImplVK> impl_;
40
41 explicit SwapchainVK(std::shared_ptr<SwapchainImplVK> impl);
42
43 FML_DISALLOW_COPY_AND_ASSIGN(SwapchainVK);
44 };
45
46 } // namespace impeller
impeller::SwapchainVK::Create
static std::shared_ptr< SwapchainVK > Create(const std::shared_ptr< Context > &context, vk::UniqueSurfaceKHR surface)
Definition: swapchain_vk.cc:12
vk.h
surface.h
impeller::SwapchainVK::IsValid
bool IsValid() const
Definition: swapchain_vk.cc:27
impeller::SwapchainVK::GetSurfaceFormat
vk::Format GetSurfaceFormat() const
Definition: swapchain_vk.cc:70
impeller::SwapchainVK
A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the...
Definition: swapchain_vk.h:24
context.h
impeller
Definition: aiks_context.cc:10
impeller::SwapchainVK::AcquireNextDrawable
std::unique_ptr< Surface > AcquireNextDrawable()
Definition: swapchain_vk.cc:31
impeller::SwapchainVK::~SwapchainVK
~SwapchainVK()