#include "common/android_util.h"
#include "common/debug.h"
#if defined(ANGLE_PLATFORM_ANDROID)
# include <sys/system_properties.h>
#endif
#if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 26
#define ANGLE_AHARDWARE_BUFFER_SUPPORT
# include <android/hardware_buffer.h>
#endif
native_handle_t;
buffer_handle_t;
android_native_base_t;
ANativeWindowBuffer_t;
namespace angle
{
namespace android
{
namespace
{
constexpr int kAHardwareBufferToANativeWindowBufferOffset = …;
template <typename T1, typename T2>
T1 *OffsetPointer(T2 *ptr, int bytes)
{ … }
GLenum GetPixelFormatInfo(int pixelFormat, bool *isYUV)
{ … }
}
ANativeWindowBuffer *ClientBufferToANativeWindowBuffer(EGLClientBuffer clientBuffer)
{ … }
uint64_t GetAHBUsage(int eglNativeBufferUsage)
{ … }
EGLClientBuffer CreateEGLClientBufferFromAHardwareBuffer(int width,
int height,
int depth,
int androidFormat,
int usage)
{ … }
void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer,
int *width,
int *height,
int *depth,
int *pixelFormat,
uint64_t *usage)
{ … }
GLenum NativePixelFormatToGLInternalFormat(int pixelFormat)
{ … }
int GLInternalFormatToNativePixelFormat(GLenum internalFormat)
{ … }
bool NativePixelFormatIsYUV(int pixelFormat)
{ … }
AHardwareBuffer *ANativeWindowBufferToAHardwareBuffer(ANativeWindowBuffer *windowBuffer)
{ … }
EGLClientBuffer AHardwareBufferToClientBuffer(const AHardwareBuffer *hardwareBuffer)
{ … }
AHardwareBuffer *ClientBufferToAHardwareBuffer(EGLClientBuffer clientBuffer)
{ … }
bool GetSystemProperty(const char *propertyName, std::string *value)
{ … }
}
}