Flutter Engine
The Flutter Engine
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
14
15namespace impeller {
16
17class 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_
~SurfaceVK() override
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
std::function< bool(void)> SwapCallback
Definition: surface_vk.h:19
uint32_t * target
Dart_NativeFunction function
Definition: fuchsia.cc:51