Flutter Impeller
proc_table.h File Reference
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <android/api-level.h>
#include <android/hardware_buffer.h>
#include <android/hardware_buffer_jni.h>
#include <android/surface_control.h>
#include <android/trace.h>
#include <functional>
#include "flutter/fml/logging.h"
#include "flutter/fml/native_library.h"

Go to the source code of this file.

Classes

struct  impeller::android::AndroidProc< T >
 
struct  impeller::android::ProcTable
 The table of Android procs that are resolved dynamically. More...
 

Namespaces

 impeller
 
 impeller::android
 

Macros

#define EGL_EGLEXT_PROTOTYPES
 
#define FOR_EACH_ANDROID_PROC(INVOKE)
 The Android procs along with the device API level on which these will be available. There is no checking of the actual API level however (because getting the API level is itself only possible on API levels 29 and above). More...
 
#define DEFINE_PROC(name, api)    AndroidProc<decltype(name)> name = {.proc_name = #name};
 

Functions

ASurfaceTransaction * impeller::android::ASurfaceTransaction_fromJava (JNIEnv *env, jobject transaction)
 
const ProcTable & impeller::android::GetProcTable ()
 

Macro Definition Documentation

◆ DEFINE_PROC

#define DEFINE_PROC (   name,
  api 
)     AndroidProc<decltype(name)> name = {.proc_name = #name};

Definition at line 122 of file proc_table.h.

◆ EGL_EGLEXT_PROTOTYPES

#define EGL_EGLEXT_PROTOTYPES

Definition at line 9 of file proc_table.h.

◆ FOR_EACH_ANDROID_PROC

#define FOR_EACH_ANDROID_PROC (   INVOKE)
Value:
INVOKE(AChoreographer_getInstance, 24) \
INVOKE(AChoreographer_postFrameCallback, 24) \
INVOKE(AChoreographer_postFrameCallback64, 29) \
INVOKE(AHardwareBuffer_acquire, 26) \
INVOKE(AHardwareBuffer_allocate, 26) \
INVOKE(AHardwareBuffer_describe, 26) \
INVOKE(AHardwareBuffer_fromHardwareBuffer, 26) \
INVOKE(AHardwareBuffer_getId, 31) \
INVOKE(AHardwareBuffer_isSupported, 29) \
INVOKE(AHardwareBuffer_lock, 26) \
INVOKE(AHardwareBuffer_release, 26) \
INVOKE(AHardwareBuffer_unlock, 26) \
INVOKE(ANativeWindow_acquire, 0) \
INVOKE(ANativeWindow_getHeight, 0) \
INVOKE(ANativeWindow_getWidth, 0) \
INVOKE(ANativeWindow_release, 0) \
INVOKE(ASurfaceControl_createFromWindow, 29) \
INVOKE(ASurfaceControl_release, 29) \
INVOKE(ASurfaceTransaction_apply, 29) \
INVOKE(ASurfaceTransaction_create, 29) \
INVOKE(ASurfaceTransaction_delete, 29) \
INVOKE(ASurfaceTransaction_reparent, 29) \
INVOKE(ASurfaceTransaction_setBuffer, 29) \
INVOKE(ASurfaceTransaction_setColor, 29) \
INVOKE(ASurfaceTransaction_setOnComplete, 29) \
INVOKE(ASurfaceTransactionStats_getPreviousReleaseFenceFd, 29) \
INVOKE(ATrace_isEnabled, 23) \
INVOKE(eglGetNativeClientBufferANDROID, 0)
ASurfaceTransaction * ASurfaceTransaction_fromJava(JNIEnv *env, jobject transaction)

The Android procs along with the device API level on which these will be available. There is no checking of the actual API level however (because getting the API level is itself only possible on API levels 29 and above).

Take care to explicitly check for the availability of these APIs at runtime before invoking them.

Typically, you'll never have to deal with the proc. table directly. Instead, rely on the handle wrappers (Choreographer, HardwareBuffer, etc..).

Definition at line 40 of file proc_table.h.