Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
impeller::android::HardwareBufferDescriptor Struct Reference

A descriptor use to specify hardware buffer allocations. More...

#include <hardware_buffer.h>

Public Member Functions

bool IsAllocatable () const
 If hardware buffers can be created using this descriptor. Allocatable descriptors may still cause failing allocations in case of resource exhaustion.
 
constexpr bool operator== (const HardwareBufferDescriptor &o) const
 
constexpr bool operator!= (const HardwareBufferDescriptor &o) const
 

Static Public Member Functions

static HardwareBufferDescriptor MakeForSwapchainImage (const ISize &size)
 Create a descriptor of the given size that is suitable for use as a swapchain image.
 

Public Attributes

HardwareBufferFormat format = HardwareBufferFormat::kR8G8B8A8UNormInt
 
ISize size
 
HardwareBufferUsage usage = HardwareBufferUsageFlags::kNone
 

Detailed Description

A descriptor use to specify hardware buffer allocations.

Definition at line 42 of file hardware_buffer.h.

Member Function Documentation

◆ IsAllocatable()

bool impeller::android::HardwareBufferDescriptor::IsAllocatable ( ) const

If hardware buffers can be created using this descriptor. Allocatable descriptors may still cause failing allocations in case of resource exhaustion.

Returns
true if allocatable (unless resource exhaustion).

Definition at line 39 of file hardware_buffer.cc.

39 {
40 const auto desc = ToAHardwareBufferDesc(*this);
41 return GetProcTable().AHardwareBuffer_isSupported(&desc) != 0u;
42}
const ProcTable & GetProcTable()
Definition proc_table.cc:12
static AHardwareBuffer_Desc ToAHardwareBufferDesc(const HardwareBufferDescriptor &desc)

◆ MakeForSwapchainImage()

HardwareBufferDescriptor impeller::android::HardwareBufferDescriptor::MakeForSwapchainImage ( const ISize size)
static

Create a descriptor of the given size that is suitable for use as a swapchain image.

Warning
Descriptors of zero size are not allocatable. The next best valid size is picked. So make sure to check the actual size of the descriptor after this call is made to determine the size of the allocated hardware buffer.
Parameters
[in]sizeThe size. See the restrictions about valid sizes above.
Returns
The hardware buffer descriptor.

Definition at line 74 of file hardware_buffer.cc.

◆ operator!=()

constexpr bool impeller::android::HardwareBufferDescriptor::operator!= ( const HardwareBufferDescriptor o) const
inlineconstexpr

Definition at line 75 of file hardware_buffer.h.

75 {
76 return !(*this == o);
77 }

◆ operator==()

constexpr bool impeller::android::HardwareBufferDescriptor::operator== ( const HardwareBufferDescriptor o) const
inlineconstexpr

Definition at line 71 of file hardware_buffer.h.

71 {
72 return format == o.format && size == o.size && usage == o.usage;
73 }

Member Data Documentation

◆ format

HardwareBufferFormat impeller::android::HardwareBufferDescriptor::format = HardwareBufferFormat::kR8G8B8A8UNormInt

Definition at line 43 of file hardware_buffer.h.

◆ size

ISize impeller::android::HardwareBufferDescriptor::size

Definition at line 44 of file hardware_buffer.h.

◆ usage

HardwareBufferUsage impeller::android::HardwareBufferDescriptor::usage = HardwareBufferUsageFlags::kNone

Definition at line 45 of file hardware_buffer.h.


The documentation for this struct was generated from the following files: