| Flutter Impeller |

khr_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_KHR_KHR_SWAPCHAIN_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_VK_H_
7
8 #include <memory>
9
10 #include "impeller/geometry/size.h"
11 #include "impeller/renderer/backend/vulkan/swapchain/swapchain_vk.h"
12 #include "impeller/renderer/backend/vulkan/vk.h"
13 #include "impeller/renderer/context.h"
14 #include "impeller/renderer/surface.h"
15
16 namespace impeller {
17
18 class KHRSwapchainImplVK;
19
20 //------------------------------------------------------------------------------
21 /// @brief A swapchain implemented backed by VK_KHR_swapchain and
22 /// VK_KHR_surface.
23 ///
24 class KHRSwapchainVK final : public SwapchainVK {
25 public:
26 ~KHRSwapchainVK();
27
28 // |SwapchainVK|
29 bool IsValid() const override;
30
31 // |SwapchainVK|
32 std::unique_ptr<Surface> AcquireNextDrawable() override;
33
34 // |SwapchainVK|
35 vk::Format GetSurfaceFormat() const override;
36
37 // |SwapchainVK|
38 void UpdateSurfaceSize(const ISize& size) override;
39
40 private:
41 friend class SwapchainVK;
42
43 std::shared_ptr<KHRSwapchainImplVK> impl_;
44 ISize size_;
45 const bool enable_msaa_;
46
47 KHRSwapchainVK(const std::shared_ptr<Context>& context,
48 vk::UniqueSurfaceKHR surface,
49 const ISize& size,
50 bool enable_msaa);
51
52 KHRSwapchainVK(const KHRSwapchainVK&) = delete;
53
54 KHRSwapchainVK& operator=(const KHRSwapchainVK&) = delete;
55 };
56
57 } // namespace impeller
58
59 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_VK_H_
impeller::KHRSwapchainVK::IsValid
bool IsValid() const override
Definition: khr_swapchain_vk.cc:32
impeller::KHRSwapchainVK::UpdateSurfaceSize
void UpdateSurfaceSize(const ISize &size) override
Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame.
Definition: khr_swapchain_vk.cc:36
swapchain_vk.h
impeller::KHRSwapchainVK::~KHRSwapchainVK
~KHRSwapchainVK()
vk.h
surface.h
impeller::TSize
Definition: size.h:19
impeller::KHRSwapchainVK::GetSurfaceFormat
vk::Format GetSurfaceFormat() const override
Definition: khr_swapchain_vk.cc:82
impeller::SwapchainVK
A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the...
Definition: swapchain_vk.h:28
impeller::KHRSwapchainVK
A swapchain implemented backed by VK_KHR_swapchain and VK_KHR_surface.
Definition: khr_swapchain_vk.h:24
context.h
impeller::KHRSwapchainVK::AcquireNextDrawable
std::unique_ptr< Surface > AcquireNextDrawable() override
Definition: khr_swapchain_vk.cc:42
impeller
Definition: allocation.cc:12
size.h