Flutter Engine
 
Loading...
Searching...
No Matches
embedder_surface_vulkan_impeller.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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_VULKAN_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_VULKAN_IMPELLER_H_
7
16
17namespace flutter {
18
21 public:
23 PFN_vkGetInstanceProcAddr get_instance_proc_address; // required
24 std::function<FlutterVulkanImage(const DlISize& frame_size)>
25 get_next_image; // required
26 std::function<bool(VkImage image, VkFormat format)>
27 present_image; // required
28 };
29
31 uint32_t version,
32 VkInstance instance,
33 size_t instance_extension_count,
34 const char** instance_extensions,
35 size_t device_extension_count,
36 const char** device_extensions,
37 VkPhysicalDevice physical_device,
38 VkDevice device,
39 uint32_t queue_family_index,
40 VkQueue queue,
41 const VulkanDispatchTable& vulkan_dispatch_table,
42 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder);
43
45
46 // |GPUSurfaceVulkanDelegate|
47 const vulkan::VulkanProcTable& vk() override;
48
49 // |GPUSurfaceVulkanDelegate|
51
52 // |GPUSurfaceVulkanDelegate|
53 bool PresentImage(VkImage image, VkFormat format) override;
54
55 // |GPUSurfaceVulkanDelegate|
56 std::shared_ptr<impeller::Context> CreateImpellerContext() const override;
57
58 private:
59 bool valid_ = false;
61 VulkanDispatchTable vulkan_dispatch_table_;
62 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
63 std::shared_ptr<impeller::ContextVK> context_;
64
65 // |EmbedderSurface|
66 bool IsValid() const override;
67
68 // |EmbedderSurface|
69 std::unique_ptr<Surface> CreateGPUSurface() override;
70
71 // |EmbedderSurface|
72 sk_sp<GrDirectContext> CreateResourceContext() const override;
73
76 const EmbedderSurfaceVulkanImpeller&) = delete;
77};
78
79} // namespace flutter
80
81#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_VULKAN_IMPELLER_H_
std::shared_ptr< impeller::Context > CreateImpellerContext() const override
FlutterVulkanImage AcquireImage(const DlISize &size) override
Called by the engine to fetch a VkImage for writing the next frame.
bool PresentImage(VkImage image, VkFormat format) override
Called by the engine once a frame has been rendered to the image and it's ready to be bound for furth...
const vulkan::VulkanProcTable & vk() override
Obtain a reference to the Vulkan implementation's proc table.
Interface implemented by all platform surfaces that can present a Vulkan backing store to the "screen...
FlutterVulkanImage * image
VkPhysicalDevice physical_device
Definition main.cc:67
VkDevice device
Definition main.cc:69
VkInstance instance
Definition main.cc:64
VkQueue queue
Definition main.cc:71
uint32_t queue_family_index
Definition main.cc:70
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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
std::function< bool(VkImage image, VkFormat format)> present_image
std::function< FlutterVulkanImage(const DlISize &frame_size)> get_next_image