| 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 // |SwapchainVK|
41 void AddFinalCommandBuffer(
42 std::shared_ptr<CommandBuffer> cmd_buffer) const override;
43
44 private:
45 friend class SwapchainVK;
46
47 std::shared_ptr<KHRSwapchainImplVK> impl_;
48 ISize size_;
49 const bool enable_msaa_;
50
51 KHRSwapchainVK(const std::shared_ptr<Context>& context,
52 vk::UniqueSurfaceKHR surface,
53 const ISize& size,
54 bool enable_msaa);
55
56 KHRSwapchainVK(const KHRSwapchainVK&) = delete;
57
58 KHRSwapchainVK& operator=(const KHRSwapchainVK&) = delete;
59 };
60
61 } // namespace impeller
62
63 #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::AddFinalCommandBuffer
void AddFinalCommandBuffer(std::shared_ptr< CommandBuffer > cmd_buffer) const override
Definition: khr_swapchain_vk.cc:42
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:25
impeller::KHRSwapchainVK::GetSurfaceFormat
vk::Format GetSurfaceFormat() const override
Definition: khr_swapchain_vk.cc:87
impeller::SwapchainVK
A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the...
Definition: swapchain_vk.h:29
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:47
impeller
Definition: allocation.cc:12
size.h