1 //
2 // Copyright 2018 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // android_util.h: Utilities for the using the Android platform
8 
9 #ifndef COMMON_ANDROIDUTIL_H_
10 #define COMMON_ANDROIDUTIL_H_
11 
12 #include <EGL/egl.h>
13 #include "angle_gl.h"
14 
15 struct ANativeWindowBuffer;
16 struct AHardwareBuffer;
17 
18 namespace angle
19 {
20 
21 namespace android
22 {
23 
24 ANativeWindowBuffer *ClientBufferToANativeWindowBuffer(EGLClientBuffer clientBuffer);
25 EGLClientBuffer AHardwareBufferToClientBuffer(const AHardwareBuffer *hardwareBuffer);
26 
27 void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer,
28                                       int *width,
29                                       int *height,
30                                       int *depth,
31                                       int *pixelFormat);
32 GLenum NativePixelFormatToGLInternalFormat(int pixelFormat);
33 int GLInternalFormatToNativePixelFormat(GLenum internalFormat);
34 
35 AHardwareBuffer *ANativeWindowBufferToAHardwareBuffer(ANativeWindowBuffer *windowBuffer);
36 
37 }  // namespace android
38 }  // namespace angle
39 
40 #endif  // COMMON_ANDROIDUTIL_H_
41