| 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 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_
7
8 #include <memory>
9
10 #include "flutter/fml/macros.h"
11 #include "impeller/renderer/backend/vulkan/vk.h"
12 #include "impeller/renderer/context.h"
13 #include "impeller/renderer/surface.h"
14
15 namespace impeller {
16
17 class SwapchainImplVK;
18
19 //------------------------------------------------------------------------------
20 /// @brief A swapchain that adapts to the underlying surface going out of
21 /// date. If the caller cannot acquire the next drawable, it is due
22 /// to an unrecoverable error and the swapchain must be recreated
23 /// with a new surface.
24 ///
25 class SwapchainVK {
26 public:
27 static std::shared_ptr<SwapchainVK> Create(
28 const std::shared_ptr<Context>& context,
29 vk::UniqueSurfaceKHR surface);
30
31 ~SwapchainVK();
32
33 bool IsValid() const;
34
35 std::unique_ptr<Surface> AcquireNextDrawable();
36
37 vk::Format GetSurfaceFormat() const;
38
39 private:
40 std::shared_ptr<SwapchainImplVK> impl_;
41
42 explicit SwapchainVK(std::shared_ptr<SwapchainImplVK> impl);
43
44 SwapchainVK(const SwapchainVK&) = delete;
45
46 SwapchainVK& operator=(const SwapchainVK&) = delete;
47 };
48
49 } // namespace impeller
50
51 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_
impeller::SwapchainVK::Create
static std::shared_ptr< SwapchainVK > Create(const std::shared_ptr< Context > &context, vk::UniqueSurfaceKHR surface)
Definition: swapchain_vk.cc:13
vk.h
surface.h
impeller::SwapchainVK::IsValid
bool IsValid() const
Definition: swapchain_vk.cc:29
impeller::SwapchainVK::GetSurfaceFormat
vk::Format GetSurfaceFormat() const
Definition: swapchain_vk.cc:72
impeller::SwapchainVK
A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the...
Definition: swapchain_vk.h:25
context.h
impeller
Definition: aiks_context.cc:10
impeller::SwapchainVK::AcquireNextDrawable
std::unique_ptr< Surface > AcquireNextDrawable()
Definition: swapchain_vk.cc:33
impeller::SwapchainVK::~SwapchainVK
~SwapchainVK()