Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
flutter_skia_vma.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_FLUTTER_VMA_FLUTTER_SKIA_VMA_H_
6#define FLUTTER_FLUTTER_VMA_FLUTTER_SKIA_VMA_H_
7
8#include "flutter/flutter_vma/flutter_vma.h"
9
10#include "flutter/fml/memory/ref_ptr.h"
11#include "flutter/vulkan/procs/vulkan_proc_table.h"
13
14namespace flutter {
15
17 public:
19 uint32_t vulkan_api_version,
20 VkInstance instance,
21 VkPhysicalDevice physicalDevice,
22 VkDevice device,
24 bool mustUseCoherentHostVisibleMemory);
25
27
29 uint32_t allocationPropertyFlags,
31
34 uint32_t allocationPropertyFlags,
36
37 void freeMemory(const skgpu::VulkanBackendMemory&) override;
38
40 skgpu::VulkanAlloc*) const override;
41
42 VkResult mapMemory(const skgpu::VulkanBackendMemory&, void** data) override;
43 void unmapMemory(const skgpu::VulkanBackendMemory&) override;
44
47 VkDeviceSize size) override;
50 VkDeviceSize size) override;
51
52 std::pair<uint64_t, uint64_t> totalAllocatedAndUsedMemory() const override;
53
54 private:
57 VmaAllocator allocator,
58 bool mustUseCoherentHostVisibleMemory);
59
61 VmaAllocator allocator_;
62
63 // For host visible allocations do we require they are coherent or not. All
64 // devices are required to support a host visible and coherent memory type.
65 // This is used to work around bugs for devices that don't handle non coherent
66 // memory correctly.
67 bool must_use_coherent_host_visible_memory_;
68};
69
70} // namespace flutter
71
72#endif // FLUTTER_FLUTTER_VMA_FLUTTER_SKIA_VMA_H_
VkResult mapMemory(const skgpu::VulkanBackendMemory &, void **data) override
static sk_sp< VulkanMemoryAllocator > Make(uint32_t vulkan_api_version, VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device, const fml::RefPtr< vulkan::VulkanProcTable > &vk, bool mustUseCoherentHostVisibleMemory)
VkResult invalidateMemory(const skgpu::VulkanBackendMemory &, VkDeviceSize offset, VkDeviceSize size) override
void freeMemory(const skgpu::VulkanBackendMemory &) override
VkResult allocateImageMemory(VkImage image, uint32_t allocationPropertyFlags, skgpu::VulkanBackendMemory *) override
VkResult allocateBufferMemory(VkBuffer buffer, BufferUsage usage, uint32_t allocationPropertyFlags, skgpu::VulkanBackendMemory *) override
void getAllocInfo(const skgpu::VulkanBackendMemory &, skgpu::VulkanAlloc *) const override
VkResult flushMemory(const skgpu::VulkanBackendMemory &, VkDeviceSize offset, VkDeviceSize size) override
std::pair< uint64_t, uint64_t > totalAllocatedAndUsedMemory() const override
void unmapMemory(const skgpu::VulkanBackendMemory &) override
VkDevice device
Definition main.cc:53
VkInstance instance
Definition main.cc:48
sk_sp< SkImage > image
Definition examples.cpp:29
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition switches.h:126
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
intptr_t VulkanBackendMemory
Definition VulkanTypes.h:31
static void usage(char *argv0)
Point offset
uint64_t VkDeviceSize
Definition vulkan_core.h:96
VkResult