Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
impeller::android Namespace Reference

Namespaces

namespace  testing
 

Classes

struct  AndroidProc
 
class  Choreographer
 This class describes access to the choreographer instance for the current thread. Choreographers are only available on API levels above 24. On levels below 24, an invalid choreographer will be returned. More...
 
class  HardwareBuffer
 A wrapper for AHardwareBuffer https://developer.android.com/ndk/reference/group/a-hardware-buffer. More...
 
struct  HardwareBufferDescriptor
 A descriptor use to specify hardware buffer allocations. More...
 
class  NativeWindow
 A wrapper for ANativeWindow https://developer.android.com/ndk/reference/group/a-native-window. More...
 
struct  ProcTable
 The table of Android procs that are resolved dynamically. More...
 
class  SurfaceControl
 A wrapper for ASurfaceControl. https://developer.android.com/ndk/reference/group/native-activity#asurfacecontrol. More...
 
class  SurfaceTransaction
 A wrapper for ASurfaceTransaction. https://developer.android.com/ndk/reference/group/native-activity#asurfacetransaction. More...
 
struct  TransactionInFlightData
 

Typedefs

using HardwareBufferUsage = Mask< HardwareBufferUsageFlags >
 

Enumerations

enum class  HardwareBufferFormat { kR8G8B8A8UNormInt }
 
enum class  HardwareBufferUsageFlags { kNone = 0u , kFrameBufferAttachment = 1u << 0u , kCompositorOverlay = 1u << 1u , kSampledImage = 1u << 2u }
 

Functions

static Choreographer::FrameTimePoint ClockMonotonicNanosToFrameTimePoint (int64_t p_nanos)
 
static AHardwareBuffer_Format ToAHardwareBufferFormat (HardwareBufferFormat format)
 
static AHardwareBuffer_Desc ToAHardwareBufferDesc (const HardwareBufferDescriptor &desc)
 
const ProcTableGetProcTable ()
 
ProcTableGetMutableProcTable ()
 
template<class T >
void ResolveAndroidProc (AndroidProc< T > &proc, const std::vector< fml::RefPtr< fml::NativeLibrary > > &libs)
 

Typedef Documentation

◆ HardwareBufferUsage

Definition at line 37 of file hardware_buffer.h.

Enumeration Type Documentation

◆ HardwareBufferFormat

Enumerator
kR8G8B8A8UNormInt 

This format is guaranteed to be supported on all versions of Android. This format can also be converted to an Impeller and Vulkan format.

See also
Vulkan Format: VK_FORMAT_R8G8B8A8_UNORM
OpenGL ES Format: GL_RGBA8

Why have many format when one format do trick?

Definition at line 17 of file hardware_buffer.h.

17 {
18 //----------------------------------------------------------------------------
19 /// This format is guaranteed to be supported on all versions of Android. This
20 /// format can also be converted to an Impeller and Vulkan format.
21 ///
22 /// @see Vulkan Format: VK_FORMAT_R8G8B8A8_UNORM
23 /// @see OpenGL ES Format: GL_RGBA8
24 ///
25 /// Why have many format when one format do trick?
26 ///
28};

◆ HardwareBufferUsageFlags

Enumerator
kNone 
kFrameBufferAttachment 
kCompositorOverlay 
kSampledImage 

Definition at line 30 of file hardware_buffer.h.

Function Documentation

◆ ClockMonotonicNanosToFrameTimePoint()

static Choreographer::FrameTimePoint impeller::android::ClockMonotonicNanosToFrameTimePoint ( int64_t  p_nanos)
static

Definition at line 33 of file choreographer.cc.

34 {
35 return Choreographer::FrameTimePoint{std::chrono::nanoseconds(p_nanos)};
36}
std::chrono::time_point< FrameClock > FrameTimePoint

◆ GetMutableProcTable()

ProcTable & impeller::android::GetMutableProcTable ( )

Definition at line 18 of file proc_table.cc.

18 {
19 return const_cast<ProcTable&>(GetProcTable());
20}
const ProcTable & GetProcTable()
Definition proc_table.cc:12
The table of Android procs that are resolved dynamically.
Definition proc_table.h:90

◆ GetProcTable()

const ProcTable & impeller::android::GetProcTable ( )

Definition at line 12 of file proc_table.cc.

12 {
13 static ProcTable gProcTable;
14 return gProcTable;
15}

◆ ResolveAndroidProc()

template<class T >
void impeller::android::ResolveAndroidProc ( AndroidProc< T > &  proc,
const std::vector< fml::RefPtr< fml::NativeLibrary > > &  libs 
)

Definition at line 23 of file proc_table.cc.

25 {
26 for (const auto& lib : libs) {
27 proc.proc = lib->ResolveFunction<T*>(proc.proc_name).value_or(nullptr);
28 if (proc.proc) {
29 break;
30 }
31 }
32}
#define T

◆ ToAHardwareBufferDesc()

static AHardwareBuffer_Desc impeller::android::ToAHardwareBufferDesc ( const HardwareBufferDescriptor desc)
static

Definition at line 20 of file hardware_buffer.cc.

21 {
22 AHardwareBuffer_Desc ahb_desc = {};
23 ahb_desc.width = desc.size.width;
24 ahb_desc.height = desc.size.height;
25 ahb_desc.format = ToAHardwareBufferFormat(desc.format);
26 ahb_desc.layers = 1u;
27 if (desc.usage & HardwareBufferUsageFlags::kFrameBufferAttachment) {
28 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER;
29 }
30 if (desc.usage & HardwareBufferUsageFlags::kCompositorOverlay) {
31 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY;
32 }
33 if (desc.usage & HardwareBufferUsageFlags::kSampledImage) {
34 ahb_desc.usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
35 }
36 return ahb_desc;
37}

◆ ToAHardwareBufferFormat()

static AHardwareBuffer_Format impeller::android::ToAHardwareBufferFormat ( HardwareBufferFormat  format)
static

Definition at line 11 of file hardware_buffer.cc.

12 {
13 switch (format) {
14 case HardwareBufferFormat::kR8G8B8A8UNormInt:
15 return AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
16 }
18}
uint32_t uint32_t * format
#define FML_UNREACHABLE()
Definition logging.h:109