 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_TOOLKIT_ANDROID_HARDWARE_BUFFER_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_ANDROID_HARDWARE_BUFFER_H_
10 #include "flutter/fml/unique_object.h"
108 static std::optional<AHardwareBuffer_Desc>
Describe(AHardwareBuffer* buffer);
129 struct UniqueAHardwareBufferTraits {
130 static AHardwareBuffer* InvalidValue() {
return nullptr; }
132 static bool IsValid(AHardwareBuffer* value) {
133 return value != InvalidValue();
136 static void Free(AHardwareBuffer* value) {
142 const AHardwareBuffer_Desc android_descriptor_;
143 fml::UniqueObject<AHardwareBuffer*, UniqueAHardwareBufferTraits> buffer_;
144 bool is_valid_ =
false;
149 #endif // FLUTTER_IMPELLER_TOOLKIT_ANDROID_HARDWARE_BUFFER_H_
static bool IsAvailableOnPlatform()
uint8_t HardwareBufferUsage
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...
const HardwareBufferDescriptor & GetDescriptor() const
HardwareBuffer & operator=(const HardwareBuffer &)=delete
static HardwareBufferDescriptor MakeForSwapchainImage(const ISize &size)
Create a descriptor of the given size that is suitable for use as a swapchain image.
A wrapper for AHardwareBuffer https://developer.android.com/ndk/reference/group/a-hardware-buffer.
constexpr bool operator!=(const HardwareBufferDescriptor &o) const
constexpr bool operator==(const HardwareBufferDescriptor &o) const
A descriptor use to specify hardware buffer allocations.
AHardwareBuffer * GetHandle() const
static std::optional< AHardwareBuffer_Desc > Describe(AHardwareBuffer *buffer)
HardwareBufferUsage usage
HardwareBuffer(HardwareBufferDescriptor descriptor)
const ProcTable & GetProcTable()
HardwareBufferFormat format
bool IsAllocatable() const
If hardware buffers can be created using this descriptor. Allocatable descriptors may still cause fai...
const AHardwareBuffer_Desc & GetAndroidDescriptor() const