15 return AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
22 AHardwareBuffer_Desc ahb_desc = {};
23 ahb_desc.width =
desc.size.width;
24 ahb_desc.height =
desc.size.height;
28 ahb_desc.usage |= (AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER |
29 AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT);
32 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY;
35 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
38 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_CPU_READ_RARELY;
41 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN;
44 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY;
47 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN;
58 : descriptor_(descriptor),
61 VALIDATION_LOG <<
"The hardware buffer descriptor is not allocatable.";
68 proc_table.AHardwareBuffer_allocate(&android_descriptor_, &
buffer);
104 return android_descriptor_;
120 uint64_t out_id = 0u;
132 AHardwareBuffer_Desc
desc = {};
138 if (!is_valid_ || !
GetProcTable().AHardwareBuffer_lock) {
144 usage |= AHARDWAREBUFFER_USAGE_CPU_READ_MASK;
147 usage |= AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK;
162 if (!is_valid_ || !
GetProcTable().AHardwareBuffer_unlock) {
struct AHardwareBuffer AHardwareBuffer
void reset(const T &value=Traits::InvalidValue())
HardwareBuffer(HardwareBufferDescriptor descriptor)
static bool IsAvailableOnPlatform()
const HardwareBufferDescriptor & GetDescriptor() const
AHardwareBuffer * GetHandle() const
const AHardwareBuffer_Desc & GetAndroidDescriptor() const
bool Unlock() const
Unlock a mapping previously locked for CPU access.
static std::optional< AHardwareBuffer_Desc > Describe(AHardwareBuffer *buffer)
void * Lock(CPUAccessType type) const
Lock the buffer for CPU access. This call may fail if the buffer was not created with one the usages ...
std::optional< uint64_t > GetSystemUniqueID() const
Get the system wide unique ID of the hardware buffer if possible. This is only available on Android A...
uint32_t uint32_t * format
#define FML_UNREACHABLE()
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
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
const ProcTable & GetProcTable()
static AHardwareBuffer_Desc ToAHardwareBufferDesc(const HardwareBufferDescriptor &desc)
static AHardwareBuffer_Format ToAHardwareBufferFormat(HardwareBufferFormat format)
static void usage(char *argv0)
constexpr TSize Max(const TSize &o) const
A descriptor use to specify hardware buffer allocations.
static HardwareBufferDescriptor MakeForSwapchainImage(const ISize &size)
Create a descriptor of the given size that is suitable for use as a swapchain image.
bool IsAllocatable() const
If hardware buffers can be created using this descriptor. Allocatable descriptors may still cause fai...
bool IsValid() const
If a valid proc table could be setup. This may fail in case of setup on non-Android platforms.