16#include "third_party/skia/include/core/SkSurface.h"
22 vulkan_context_ = fml::MakeRefCounted<TestVulkanContext>();
26 .version = vulkan_context_->application_->GetAPIVersion(),
27 .instance = vulkan_context_->application_->GetInstance(),
28 .physical_device = vulkan_context_->device_->GetPhysicalDeviceHandle(),
29 .device = vulkan_context_->device_->GetHandle(),
30 .queue_family_index = vulkan_context_->device_->GetGraphicsQueueIndex(),
31 .queue = vulkan_context_->device_->GetQueueHandle(),
32 .get_instance_proc_address_callback =
34 .get_next_image_callback =
39 {
static_cast<int>(frame_info->size.width),
40 static_cast<int>(frame_info->size.height)});
44 .
format = VK_FORMAT_R8G8B8A8_UNORM,
47 .present_image_callback = [](
void* context,
67 return present_count_;
71 return surface_->GetImage();
76 [&]() {
return surface_->GetSurfaceSnapshot(); });
86 ->vulkan_context_->vk_->GetInstanceProcAddr(
88 return reinterpret_cast<void*
>(proc_addr);
91void EmbedderTestContextVulkan::SetSurface(
DlISize surface_size) {
93 surface_size_ = surface_size;
97void EmbedderTestContextVulkan::SetupCompositor() {
100 <<
"Set up the Vulkan surface before setting up a compositor.";
101 compositor_ = std::make_unique<EmbedderTestCompositorVulkan>(
102 surface_size_, vulkan_context_->GetGrDirectContext());
FlutterRendererConfig renderer_config_
std::unique_ptr< EmbedderTestCompositor > compositor_
void FireRootSurfacePresentCallbackIfPresent(const std::function< sk_sp< SkImage >(void)> &image_callback)
bool PresentImage(VkImage image)
EmbedderTestContextVulkan(std::string assets_path="")
VkImage GetNextImage(const DlISize &size)
static void * InstanceProcAddr(void *user_data, FlutterVulkanInstanceHandle instance, const char *name)
EmbedderTestContextType GetContextType() const override
size_t GetSurfacePresentCount() const override
void SetVulkanInstanceProcAddressCallback(FlutterVulkanInstanceProcAddressCallback callback)
~EmbedderTestContextVulkan() override
static std::unique_ptr< TestVulkanSurface > Create(const TestVulkanContext &context, const DlISize &surface_size)
void *(* FlutterVulkanInstanceProcAddressCallback)(void *, FlutterVulkanInstanceHandle, const char *)
void * FlutterVulkanInstanceHandle
Alias for VkInstance.
FlutterVulkanImage * image
FlutterDesktopBinaryReply callback
#define FML_CHECK(condition)
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
DEF_SWITCHES_START aot vmservice shared library name
FlutterVulkanRendererConfig vulkan
FlutterVulkanImageHandle image
uint32_t format
The VkFormat of the image (for example: VK_FORMAT_R8G8B8A8_UNORM).
FlutterVulkanInstanceProcAddressCallback get_instance_proc_address_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterVulkanRendererConfig).
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.