5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_VULKAN_SURFACE_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_VULKAN_SURFACE_H_
8#include <lib/async/cpp/wait.h>
9#include <lib/zx/event.h>
10#include <lib/zx/vmo.h>
16#include "flutter/fml/macros.h"
17#include "flutter/vulkan/procs/vulkan_handle.h"
18#include "flutter/vulkan/procs/vulkan_proc_table.h"
19#include "flutter/vulkan/vulkan_command_buffer.h"
20#include "flutter/vulkan/vulkan_provider.h"
47 fuchsia::sysmem::AllocatorSyncPtr& sysmem_allocator,
48 fuchsia::ui::composition::AllocatorPtr& flatland_allocator,
69 const std::function<
void(
void)>& on_writes_committed)
override;
81 fuchsia::ui::composition::BufferCollectionImportToken
99 return acquire_semaphore_;
104 if (!command_buffer_)
105 command_buffer_ = std::make_unique<vulkan::VulkanCommandBuffer>(
107 return command_buffer_.get();
111 return command_buffer_fence_;
125 return std::equal(size_history_.begin() + 1, size_history_.end(),
126 size_history_.begin());
130 static constexpr int kSizeHistorySize = 4;
132 void OnHandleReady(async_dispatcher_t* dispatcher,
133 async::WaitBase* wait,
135 const zx_packet_signal_t* signal);
137 bool AllocateDeviceMemory(
138 fuchsia::sysmem::AllocatorSyncPtr& sysmem_allocator,
139 fuchsia::ui::composition::AllocatorPtr& flatland_allocator,
166 fuchsia::ui::composition::BufferCollectionImportToken import_token_;
167 uint32_t image_id_ = 0;
171 std::unique_ptr<vulkan::VulkanCommandBuffer> command_buffer_;
173 async::WaitMethod<VulkanSurface, &VulkanSurface::OnHandleReady> wait_;
175 std::array<SkISize, kSizeHistorySize> size_history_;
176 int size_history_index_ = 0;
static bool equal(const SkBitmap &a, const SkBitmap &b)
const vulkan::VulkanHandle< VkFence > & GetCommandBufferFence()
const vulkan::VulkanHandle< VkImage > & GetVkImage()
void SetReleaseImageCallback(ReleaseImageCallback release_image_callback) override
fuchsia::ui::composition::BufferCollectionImportToken GetBufferCollectionImportToken() override
bool IsValid() const override
vulkan::VulkanCommandBuffer * GetCommandBuffer(const vulkan::VulkanHandle< VkCommandPool > &pool)
zx::event GetAcquireFence() override
~VulkanSurface() override
void SignalWritesFinished(const std::function< void(void)> &on_writes_committed) override
size_t GetAllocationSize() const
SkISize GetSize() const override
bool FlushSessionAcquireAndReleaseEvents() override
uint32_t GetImageId() override
void SetImageId(uint32_t image_id) override
size_t AdvanceAndGetAge() override
const vulkan::VulkanHandle< VkSemaphore > & GetAcquireVkSemaphore()
sk_sp< SkSurface > GetSkiaSurface() const override
zx::event GetReleaseFence() override
size_t GetImageMemoryRequirementsSize() const
VulkanSurface(vulkan::VulkanProvider &vulkan_provider, fuchsia::sysmem::AllocatorSyncPtr &sysmem_allocator, fuchsia::ui::composition::AllocatorPtr &flatland_allocator, sk_sp< GrDirectContext > context, const SkISize &size)
bool HasStableSizeHistory() const
virtual const vulkan::VulkanProcTable & vk()=0
virtual const vulkan::VulkanHandle< VkDevice > & vk_device()=0
Dart_NativeFunction function
std::function< void()> ReleaseImageCallback
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
VkDeviceSize allocationSize
VkImageCreateInfo vk_image_create_info
VkMemoryRequirements vk_memory_requirements
VkBufferCollectionImageCreateInfoFUCHSIA vk_collection_image_create_info
VulkanImage & operator=(VulkanImage &&)=default
vulkan::VulkanHandle< VkImage > vk_image
VulkanImage(VulkanImage &&)=default
FML_DISALLOW_COPY_AND_ASSIGN(VulkanImage)