5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEST_MOCK_VULKAN_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEST_MOCK_VULKAN_H_
15#include "vulkan/vulkan_core.h"
16#include "vulkan/vulkan_enums.hpp"
30 VkResult
GetStatus() {
return static_cast<VkResult
>(result_.load()); }
33 void SetStatus(vk::Result result) { result_ = result; }
36 static void SetStatus(vk::UniqueFence& fence, vk::Result result) {
38 VkFence raw_fence = fence.get();
46 VkFence raw_fence = fence.get();
52 std::atomic<vk::Result> result_ = vk::Result::eSuccess;
70 std::shared_ptr<ContextVK>
Build();
76 settings_callback_ = settings_callback;
81 const std::vector<std::string>& instance_extensions) {
82 instance_extensions_ = instance_extensions;
87 const std::vector<std::string>& instance_layers) {
88 instance_layers_ = instance_layers;
95 std::function<
void(VkPhysicalDevice physicalDevice,
97 VkFormatProperties* pFormatProperties)>
98 format_properties_callback) {
99 format_properties_callback_ = std::move(format_properties_callback);
104 std::function<
void(VkPhysicalDevice
device,
105 VkPhysicalDeviceProperties* physicalProperties)>
106 physical_properties_callback) {
107 physical_properties_callback_ = std::move(physical_properties_callback);
113 embedder_data_ = embedder_data;
119 std::vector<std::string> instance_extensions_;
120 std::vector<std::string> instance_layers_;
121 std::optional<ContextVK::EmbedderData> embedder_data_;
122 std::function<void(VkPhysicalDevice physicalDevice,
124 VkFormatProperties* pFormatProperties)>
125 format_properties_callback_;
126 std::function<void(VkPhysicalDevice
device,
127 VkPhysicalDeviceProperties* physicalProperties)>
128 physical_properties_callback_;
135 VkCommandBuffer buffer);
void SetStatus(vk::Result result)
static MockFence * GetRawPointer(vk::UniqueFence &fence)
static void SetStatus(vk::UniqueFence &fence, vk::Result result)
MockVulkanContextBuilder & SetPhysicalPropertiesCallback(std::function< void(VkPhysicalDevice device, VkPhysicalDeviceProperties *physicalProperties)> physical_properties_callback)
MockVulkanContextBuilder SetEmbedderData(const ContextVK::EmbedderData &embedder_data)
std::shared_ptr< ContextVK > Build()
Create a Vulkan context with Vulkan functions mocked. The caller is given a chance to tinker on the s...
MockVulkanContextBuilder & SetInstanceExtensions(const std::vector< std::string > &instance_extensions)
MockVulkanContextBuilder()
MockVulkanContextBuilder & SetInstanceLayers(const std::vector< std::string > &instance_layers)
MockVulkanContextBuilder & SetPhysicalDeviceFormatPropertiesCallback(std::function< void(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties)> format_properties_callback)
MockVulkanContextBuilder & SetSettingsCallback(const std::function< void(ContextVK::Settings &)> &settings_callback)
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::shared_ptr< std::vector< std::string > > GetMockVulkanFunctions(VkDevice device)
std::vector< VkImageMemoryBarrier > & GetImageMemoryBarriers(VkCommandBuffer buffer)
void SetSwapchainImageSize(ISize size)
Override the image size returned by all swapchain images.