Flutter Engine
The Flutter Engine
ahb_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_AHB_AHB_SWAPCHAIN_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_SWAPCHAIN_VK_H_
7
12
13namespace impeller {
14
15//------------------------------------------------------------------------------
16/// @brief The implementation of a swapchain that uses hardware buffers
17/// presented to a given surface control on Android.
18///
19/// @warning This swapchain implementation is not available on all Android
20/// versions supported by Flutter. Perform the
21/// `IsAvailableOnPlatform` check and fallback to KHR swapchains if
22/// this type of swapchain cannot be created. The available building
23/// blocks for these kinds of swapchains are only available on
24/// Android API levels >= 29.
25///
26class AHBSwapchainVK final : public SwapchainVK {
27 public:
28 static bool IsAvailableOnPlatform();
29
30 // |SwapchainVK|
31 ~AHBSwapchainVK() override;
32
34
36
37 // |SwapchainVK|
38 bool IsValid() const override;
39
40 // |SwapchainVK|
41 std::unique_ptr<Surface> AcquireNextDrawable() override;
42
43 // |SwapchainVK|
44 vk::Format GetSurfaceFormat() const override;
45
46 // |SwapchainVK|
47 void UpdateSurfaceSize(const ISize& size) override;
48
49 private:
50 friend class SwapchainVK;
51
52 std::weak_ptr<Context> context_;
53 std::shared_ptr<android::SurfaceControl> surface_control_;
54 const bool enable_msaa_;
55 size_t swapchain_image_count_ = 3u;
56 std::shared_ptr<AHBSwapchainImplVK> impl_;
57
58 explicit AHBSwapchainVK(const std::shared_ptr<Context>& context,
60 const vk::UniqueSurfaceKHR& surface,
61 const ISize& size,
62 bool enable_msaa);
63};
64
65} // namespace impeller
66
67#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_SWAPCHAIN_VK_H_
The implementation of a swapchain that uses hardware buffers presented to a given surface control on ...
static bool IsAvailableOnPlatform()
void UpdateSurfaceSize(const ISize &size) override
Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame.
AHBSwapchainVK & operator=(const AHBSwapchainVK &)=delete
bool IsValid() const override
vk::Format GetSurfaceFormat() const override
std::unique_ptr< Surface > AcquireNextDrawable() override
AHBSwapchainVK(const AHBSwapchainVK &)=delete
A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the...
Definition: swapchain_vk.h:28
GLFWwindow * window
Definition: main.cc:45
VkSurfaceKHR surface
Definition: main.cc:49
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
def Format(template, **parameters)
Definition: emitter.py:13
struct ANativeWindow ANativeWindow