| Flutter Impeller |

surface_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_SURFACE_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_SURFACE_VK_H_
7
8 #include <memory>
9
10 #include "impeller/renderer/backend/vulkan/context_vk.h"
11 #include "impeller/renderer/backend/vulkan/swapchain/swapchain_transients_vk.h"
12 #include "impeller/renderer/backend/vulkan/texture_source_vk.h"
13 #include "impeller/renderer/surface.h"
14
15 namespace impeller {
16
17 class SurfaceVK final : public Surface {
18 public:
19 using SwapCallback = std::function<bool(void)>;
20
21 /// @brief Wrap the swapchain image in a Surface, which provides the
22 /// additional configuration required for usage as on onscreen render
23 /// target by Impeller.
24 ///
25 /// This creates the associated MSAA and depth+stencil texture.
26 static std::unique_ptr<SurfaceVK> WrapSwapchainImage(
27 const std::shared_ptr<SwapchainTransientsVK>& transients,
28 const std::shared_ptr<TextureSourceVK>& swapchain_image,
29 SwapCallback swap_callback);
30
31 // |Surface|
32 ~SurfaceVK() override;
33
34 private:
35 SwapCallback swap_callback_;
36
37 SurfaceVK(const RenderTarget& target, SwapCallback swap_callback);
38
39 // |Surface|
40 bool Present() const override;
41
42 SurfaceVK(const SurfaceVK&) = delete;
43
44 SurfaceVK& operator=(const SurfaceVK&) = delete;
45 };
46
47 } // namespace impeller
48
49 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_SURFACE_VK_H_
impeller::RenderTarget
Definition: render_target.h:38
impeller::Surface
Definition: surface.h:12
impeller::SurfaceVK
Definition: surface_vk.h:17
impeller::SurfaceVK::~SurfaceVK
~SurfaceVK() override
impeller::SurfaceVK::WrapSwapchainImage
static std::unique_ptr< SurfaceVK > WrapSwapchainImage(const std::shared_ptr< SwapchainTransientsVK > &transients, const std::shared_ptr< TextureSourceVK > &swapchain_image, SwapCallback swap_callback)
Wrap the swapchain image in a Surface, which provides the additional configuration required for usage...
Definition: surface_vk.cc:13
impeller::SurfaceVK::SwapCallback
std::function< bool(void)> SwapCallback
Definition: surface_vk.h:19
impeller
Definition: allocation.cc:12
context_vk.h
surface.h
swapchain_transients_vk.h
texture_source_vk.h