xref: /aosp_15_r20/frameworks/native/opengl/libs/EGL/eglApi.cpp (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1*38e8c45fSAndroid Build Coastguard Worker /*
2*38e8c45fSAndroid Build Coastguard Worker  ** Copyright 2018, The Android Open Source Project
3*38e8c45fSAndroid Build Coastguard Worker  **
4*38e8c45fSAndroid Build Coastguard Worker  ** Licensed under the Apache License, Version 2.0 (the "License");
5*38e8c45fSAndroid Build Coastguard Worker  ** you may not use this file except in compliance with the License.
6*38e8c45fSAndroid Build Coastguard Worker  ** You may obtain a copy of the License at
7*38e8c45fSAndroid Build Coastguard Worker  **
8*38e8c45fSAndroid Build Coastguard Worker  **     http://www.apache.org/licenses/LICENSE-2.0
9*38e8c45fSAndroid Build Coastguard Worker  **
10*38e8c45fSAndroid Build Coastguard Worker  ** Unless required by applicable law or agreed to in writing, software
11*38e8c45fSAndroid Build Coastguard Worker  ** distributed under the License is distributed on an "AS IS" BASIS,
12*38e8c45fSAndroid Build Coastguard Worker  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*38e8c45fSAndroid Build Coastguard Worker  ** See the License for the specific language governing permissions and
14*38e8c45fSAndroid Build Coastguard Worker  ** limitations under the License.
15*38e8c45fSAndroid Build Coastguard Worker  */
16*38e8c45fSAndroid Build Coastguard Worker 
17*38e8c45fSAndroid Build Coastguard Worker #define ATRACE_TAG ATRACE_TAG_GRAPHICS
18*38e8c45fSAndroid Build Coastguard Worker 
19*38e8c45fSAndroid Build Coastguard Worker #include <EGL/egl.h>
20*38e8c45fSAndroid Build Coastguard Worker #include <EGL/eglext.h>
21*38e8c45fSAndroid Build Coastguard Worker 
22*38e8c45fSAndroid Build Coastguard Worker #include "../egl_impl.h"
23*38e8c45fSAndroid Build Coastguard Worker #include "egl_layers.h"
24*38e8c45fSAndroid Build Coastguard Worker #include "egl_platform_entries.h"
25*38e8c45fSAndroid Build Coastguard Worker #include "egl_tls.h"
26*38e8c45fSAndroid Build Coastguard Worker #include "egl_trace.h"
27*38e8c45fSAndroid Build Coastguard Worker 
28*38e8c45fSAndroid Build Coastguard Worker using namespace android;
29*38e8c45fSAndroid Build Coastguard Worker 
30*38e8c45fSAndroid Build Coastguard Worker namespace android {
31*38e8c45fSAndroid Build Coastguard Worker 
32*38e8c45fSAndroid Build Coastguard Worker extern EGLBoolean egl_init_drivers();
33*38e8c45fSAndroid Build Coastguard Worker 
34*38e8c45fSAndroid Build Coastguard Worker } // namespace android
35*38e8c45fSAndroid Build Coastguard Worker 
clearError()36*38e8c45fSAndroid Build Coastguard Worker static inline void clearError() {
37*38e8c45fSAndroid Build Coastguard Worker     egl_tls_t::clearError();
38*38e8c45fSAndroid Build Coastguard Worker }
39*38e8c45fSAndroid Build Coastguard Worker 
eglGetDisplay(EGLNativeDisplayType display)40*38e8c45fSAndroid Build Coastguard Worker EGLDisplay eglGetDisplay(EGLNativeDisplayType display) {
41*38e8c45fSAndroid Build Coastguard Worker     ATRACE_CALL();
42*38e8c45fSAndroid Build Coastguard Worker 
43*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
44*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
45*38e8c45fSAndroid Build Coastguard Worker     }
46*38e8c45fSAndroid Build Coastguard Worker 
47*38e8c45fSAndroid Build Coastguard Worker     // Call down the chain, which usually points directly to the impl
48*38e8c45fSAndroid Build Coastguard Worker     // but may also be routed through layers
49*38e8c45fSAndroid Build Coastguard Worker     clearError();
50*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
51*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetDisplay(display);
52*38e8c45fSAndroid Build Coastguard Worker }
53*38e8c45fSAndroid Build Coastguard Worker 
eglGetPlatformDisplay(EGLenum platform,EGLNativeDisplayType display,const EGLAttrib * attrib_list)54*38e8c45fSAndroid Build Coastguard Worker EGLDisplay eglGetPlatformDisplay(EGLenum platform, EGLNativeDisplayType display,
55*38e8c45fSAndroid Build Coastguard Worker                                  const EGLAttrib* attrib_list) {
56*38e8c45fSAndroid Build Coastguard Worker     ATRACE_CALL();
57*38e8c45fSAndroid Build Coastguard Worker 
58*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
59*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
60*38e8c45fSAndroid Build Coastguard Worker     }
61*38e8c45fSAndroid Build Coastguard Worker 
62*38e8c45fSAndroid Build Coastguard Worker     // Call down the chain, which usually points directly to the impl
63*38e8c45fSAndroid Build Coastguard Worker     // but may also be routed through layers
64*38e8c45fSAndroid Build Coastguard Worker     clearError();
65*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
66*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetPlatformDisplay(platform, display, attrib_list);
67*38e8c45fSAndroid Build Coastguard Worker }
68*38e8c45fSAndroid Build Coastguard Worker 
eglInitialize(EGLDisplay dpy,EGLint * major,EGLint * minor)69*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) {
70*38e8c45fSAndroid Build Coastguard Worker     clearError();
71*38e8c45fSAndroid Build Coastguard Worker 
72*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
73*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglInitialize(dpy, major, minor);
74*38e8c45fSAndroid Build Coastguard Worker }
75*38e8c45fSAndroid Build Coastguard Worker 
eglTerminate(EGLDisplay dpy)76*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglTerminate(EGLDisplay dpy) {
77*38e8c45fSAndroid Build Coastguard Worker     clearError();
78*38e8c45fSAndroid Build Coastguard Worker 
79*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
80*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglTerminate(dpy);
81*38e8c45fSAndroid Build Coastguard Worker }
82*38e8c45fSAndroid Build Coastguard Worker 
eglGetConfigs(EGLDisplay dpy,EGLConfig * configs,EGLint config_size,EGLint * num_config)83*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig* configs, EGLint config_size,
84*38e8c45fSAndroid Build Coastguard Worker                          EGLint* num_config) {
85*38e8c45fSAndroid Build Coastguard Worker     clearError();
86*38e8c45fSAndroid Build Coastguard Worker 
87*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
88*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetConfigs(dpy, configs, config_size, num_config);
89*38e8c45fSAndroid Build Coastguard Worker }
90*38e8c45fSAndroid Build Coastguard Worker 
eglChooseConfig(EGLDisplay dpy,const EGLint * attrib_list,EGLConfig * configs,EGLint config_size,EGLint * num_config)91*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs,
92*38e8c45fSAndroid Build Coastguard Worker                            EGLint config_size, EGLint* num_config) {
93*38e8c45fSAndroid Build Coastguard Worker     clearError();
94*38e8c45fSAndroid Build Coastguard Worker 
95*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
96*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglChooseConfig(dpy, attrib_list, configs, config_size, num_config);
97*38e8c45fSAndroid Build Coastguard Worker }
98*38e8c45fSAndroid Build Coastguard Worker 
eglGetConfigAttrib(EGLDisplay dpy,EGLConfig config,EGLint attribute,EGLint * value)99*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value) {
100*38e8c45fSAndroid Build Coastguard Worker     clearError();
101*38e8c45fSAndroid Build Coastguard Worker 
102*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
103*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetConfigAttrib(dpy, config, attribute, value);
104*38e8c45fSAndroid Build Coastguard Worker }
105*38e8c45fSAndroid Build Coastguard Worker 
eglCreateWindowSurface(EGLDisplay dpy,EGLConfig config,NativeWindowType window,const EGLint * attrib_list)106*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, NativeWindowType window,
107*38e8c45fSAndroid Build Coastguard Worker                                   const EGLint* attrib_list) {
108*38e8c45fSAndroid Build Coastguard Worker     clearError();
109*38e8c45fSAndroid Build Coastguard Worker 
110*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
111*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateWindowSurface(dpy, config, window, attrib_list);
112*38e8c45fSAndroid Build Coastguard Worker }
113*38e8c45fSAndroid Build Coastguard Worker 
eglCreatePlatformWindowSurface(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLAttrib * attrib_list)114*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void* native_window,
115*38e8c45fSAndroid Build Coastguard Worker                                           const EGLAttrib* attrib_list) {
116*38e8c45fSAndroid Build Coastguard Worker     clearError();
117*38e8c45fSAndroid Build Coastguard Worker 
118*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
119*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreatePlatformWindowSurface(dpy, config, native_window, attrib_list);
120*38e8c45fSAndroid Build Coastguard Worker }
121*38e8c45fSAndroid Build Coastguard Worker 
eglCreatePixmapSurface(EGLDisplay dpy,EGLConfig config,NativePixmapType pixmap,const EGLint * attrib_list)122*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap,
123*38e8c45fSAndroid Build Coastguard Worker                                   const EGLint* attrib_list) {
124*38e8c45fSAndroid Build Coastguard Worker     clearError();
125*38e8c45fSAndroid Build Coastguard Worker 
126*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
127*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreatePixmapSurface(dpy, config, pixmap, attrib_list);
128*38e8c45fSAndroid Build Coastguard Worker }
129*38e8c45fSAndroid Build Coastguard Worker 
eglCreatePlatformPixmapSurface(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLAttrib * attrib_list)130*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreatePlatformPixmapSurface(EGLDisplay dpy, EGLConfig config, void* native_pixmap,
131*38e8c45fSAndroid Build Coastguard Worker                                           const EGLAttrib* attrib_list) {
132*38e8c45fSAndroid Build Coastguard Worker     clearError();
133*38e8c45fSAndroid Build Coastguard Worker 
134*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
135*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreatePlatformPixmapSurface(dpy, config, native_pixmap, attrib_list);
136*38e8c45fSAndroid Build Coastguard Worker }
137*38e8c45fSAndroid Build Coastguard Worker 
eglCreatePbufferSurface(EGLDisplay dpy,EGLConfig config,const EGLint * attrib_list)138*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list) {
139*38e8c45fSAndroid Build Coastguard Worker     clearError();
140*38e8c45fSAndroid Build Coastguard Worker 
141*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
142*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreatePbufferSurface(dpy, config, attrib_list);
143*38e8c45fSAndroid Build Coastguard Worker }
144*38e8c45fSAndroid Build Coastguard Worker 
eglDestroySurface(EGLDisplay dpy,EGLSurface surface)145*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) {
146*38e8c45fSAndroid Build Coastguard Worker     clearError();
147*38e8c45fSAndroid Build Coastguard Worker 
148*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
149*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroySurface(dpy, surface);
150*38e8c45fSAndroid Build Coastguard Worker }
151*38e8c45fSAndroid Build Coastguard Worker 
eglQuerySurface(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint * value)152*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value) {
153*38e8c45fSAndroid Build Coastguard Worker     clearError();
154*38e8c45fSAndroid Build Coastguard Worker 
155*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
156*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQuerySurface(dpy, surface, attribute, value);
157*38e8c45fSAndroid Build Coastguard Worker }
158*38e8c45fSAndroid Build Coastguard Worker 
eglBeginFrame(EGLDisplay dpy,EGLSurface surface)159*38e8c45fSAndroid Build Coastguard Worker void EGLAPI eglBeginFrame(EGLDisplay dpy, EGLSurface surface) {
160*38e8c45fSAndroid Build Coastguard Worker     ATRACE_CALL();
161*38e8c45fSAndroid Build Coastguard Worker     clearError();
162*38e8c45fSAndroid Build Coastguard Worker 
163*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
164*38e8c45fSAndroid Build Coastguard Worker     cnx->platform.eglBeginFrame(dpy, surface);
165*38e8c45fSAndroid Build Coastguard Worker }
166*38e8c45fSAndroid Build Coastguard Worker 
eglCreateContext(EGLDisplay dpy,EGLConfig config,EGLContext share_list,const EGLint * attrib_list)167*38e8c45fSAndroid Build Coastguard Worker EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
168*38e8c45fSAndroid Build Coastguard Worker                             const EGLint* attrib_list) {
169*38e8c45fSAndroid Build Coastguard Worker     clearError();
170*38e8c45fSAndroid Build Coastguard Worker 
171*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
172*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateContext(dpy, config, share_list, attrib_list);
173*38e8c45fSAndroid Build Coastguard Worker }
174*38e8c45fSAndroid Build Coastguard Worker 
eglDestroyContext(EGLDisplay dpy,EGLContext ctx)175*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
176*38e8c45fSAndroid Build Coastguard Worker     clearError();
177*38e8c45fSAndroid Build Coastguard Worker 
178*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
179*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroyContext(dpy, ctx);
180*38e8c45fSAndroid Build Coastguard Worker }
181*38e8c45fSAndroid Build Coastguard Worker 
eglMakeCurrent(EGLDisplay dpy,EGLSurface draw,EGLSurface read,EGLContext ctx)182*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) {
183*38e8c45fSAndroid Build Coastguard Worker     clearError();
184*38e8c45fSAndroid Build Coastguard Worker 
185*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
186*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglMakeCurrent(dpy, draw, read, ctx);
187*38e8c45fSAndroid Build Coastguard Worker }
188*38e8c45fSAndroid Build Coastguard Worker 
eglQueryContext(EGLDisplay dpy,EGLContext ctx,EGLint attribute,EGLint * value)189*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint* value) {
190*38e8c45fSAndroid Build Coastguard Worker     clearError();
191*38e8c45fSAndroid Build Coastguard Worker 
192*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
193*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryContext(dpy, ctx, attribute, value);
194*38e8c45fSAndroid Build Coastguard Worker }
195*38e8c45fSAndroid Build Coastguard Worker 
eglGetCurrentContext(void)196*38e8c45fSAndroid Build Coastguard Worker EGLContext eglGetCurrentContext(void) {
197*38e8c45fSAndroid Build Coastguard Worker     clearError();
198*38e8c45fSAndroid Build Coastguard Worker 
199*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
200*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetCurrentContext();
201*38e8c45fSAndroid Build Coastguard Worker }
202*38e8c45fSAndroid Build Coastguard Worker 
eglGetCurrentSurface(EGLint readdraw)203*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglGetCurrentSurface(EGLint readdraw) {
204*38e8c45fSAndroid Build Coastguard Worker     clearError();
205*38e8c45fSAndroid Build Coastguard Worker 
206*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
207*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetCurrentSurface(readdraw);
208*38e8c45fSAndroid Build Coastguard Worker }
209*38e8c45fSAndroid Build Coastguard Worker 
eglGetCurrentDisplay(void)210*38e8c45fSAndroid Build Coastguard Worker EGLDisplay eglGetCurrentDisplay(void) {
211*38e8c45fSAndroid Build Coastguard Worker     clearError();
212*38e8c45fSAndroid Build Coastguard Worker 
213*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
214*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetCurrentDisplay();
215*38e8c45fSAndroid Build Coastguard Worker }
216*38e8c45fSAndroid Build Coastguard Worker 
eglWaitGL(void)217*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglWaitGL(void) {
218*38e8c45fSAndroid Build Coastguard Worker     clearError();
219*38e8c45fSAndroid Build Coastguard Worker 
220*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
221*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglWaitGL();
222*38e8c45fSAndroid Build Coastguard Worker }
223*38e8c45fSAndroid Build Coastguard Worker 
eglWaitNative(EGLint engine)224*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglWaitNative(EGLint engine) {
225*38e8c45fSAndroid Build Coastguard Worker     clearError();
226*38e8c45fSAndroid Build Coastguard Worker 
227*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
228*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglWaitNative(engine);
229*38e8c45fSAndroid Build Coastguard Worker }
230*38e8c45fSAndroid Build Coastguard Worker 
eglGetError(void)231*38e8c45fSAndroid Build Coastguard Worker EGLint eglGetError(void) {
232*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
233*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetError();
234*38e8c45fSAndroid Build Coastguard Worker }
235*38e8c45fSAndroid Build Coastguard Worker 
eglGetProcAddress(const char * procname)236*38e8c45fSAndroid Build Coastguard Worker __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char* procname) {
237*38e8c45fSAndroid Build Coastguard Worker     // eglGetProcAddress() could be the very first function called
238*38e8c45fSAndroid Build Coastguard Worker     // in which case we must make sure we've initialized ourselves, this
239*38e8c45fSAndroid Build Coastguard Worker     // happens the first time egl_get_display() is called.
240*38e8c45fSAndroid Build Coastguard Worker 
241*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
242*38e8c45fSAndroid Build Coastguard Worker         setError(EGL_BAD_PARAMETER, NULL);
243*38e8c45fSAndroid Build Coastguard Worker         return nullptr;
244*38e8c45fSAndroid Build Coastguard Worker     }
245*38e8c45fSAndroid Build Coastguard Worker 
246*38e8c45fSAndroid Build Coastguard Worker     clearError();
247*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
248*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetProcAddress(procname);
249*38e8c45fSAndroid Build Coastguard Worker }
250*38e8c45fSAndroid Build Coastguard Worker 
eglSwapBuffersWithDamageKHR(EGLDisplay dpy,EGLSurface draw,const EGLint * rects,EGLint n_rects)251*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface draw, const EGLint* rects,
252*38e8c45fSAndroid Build Coastguard Worker                                        EGLint n_rects) {
253*38e8c45fSAndroid Build Coastguard Worker     ATRACE_CALL();
254*38e8c45fSAndroid Build Coastguard Worker     clearError();
255*38e8c45fSAndroid Build Coastguard Worker 
256*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
257*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSwapBuffersWithDamageKHR(dpy, draw, rects, n_rects);
258*38e8c45fSAndroid Build Coastguard Worker }
259*38e8c45fSAndroid Build Coastguard Worker 
eglSwapBuffers(EGLDisplay dpy,EGLSurface surface)260*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) {
261*38e8c45fSAndroid Build Coastguard Worker     ATRACE_CALL();
262*38e8c45fSAndroid Build Coastguard Worker     clearError();
263*38e8c45fSAndroid Build Coastguard Worker 
264*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
265*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSwapBuffers(dpy, surface);
266*38e8c45fSAndroid Build Coastguard Worker }
267*38e8c45fSAndroid Build Coastguard Worker 
eglCopyBuffers(EGLDisplay dpy,EGLSurface surface,NativePixmapType target)268*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, NativePixmapType target) {
269*38e8c45fSAndroid Build Coastguard Worker     clearError();
270*38e8c45fSAndroid Build Coastguard Worker 
271*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
272*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCopyBuffers(dpy, surface, target);
273*38e8c45fSAndroid Build Coastguard Worker }
274*38e8c45fSAndroid Build Coastguard Worker 
eglQueryString(EGLDisplay dpy,EGLint name)275*38e8c45fSAndroid Build Coastguard Worker const char* eglQueryString(EGLDisplay dpy, EGLint name) {
276*38e8c45fSAndroid Build Coastguard Worker     clearError();
277*38e8c45fSAndroid Build Coastguard Worker 
278*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
279*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryString(dpy, name);
280*38e8c45fSAndroid Build Coastguard Worker }
281*38e8c45fSAndroid Build Coastguard Worker 
eglQueryStringImplementationANDROID(EGLDisplay dpy,EGLint name)282*38e8c45fSAndroid Build Coastguard Worker extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name) {
283*38e8c45fSAndroid Build Coastguard Worker     clearError();
284*38e8c45fSAndroid Build Coastguard Worker 
285*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
286*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryStringImplementationANDROID(dpy, name);
287*38e8c45fSAndroid Build Coastguard Worker }
288*38e8c45fSAndroid Build Coastguard Worker 
eglSurfaceAttrib(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint value)289*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) {
290*38e8c45fSAndroid Build Coastguard Worker     clearError();
291*38e8c45fSAndroid Build Coastguard Worker 
292*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
293*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSurfaceAttrib(dpy, surface, attribute, value);
294*38e8c45fSAndroid Build Coastguard Worker }
295*38e8c45fSAndroid Build Coastguard Worker 
eglBindTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)296*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) {
297*38e8c45fSAndroid Build Coastguard Worker     clearError();
298*38e8c45fSAndroid Build Coastguard Worker 
299*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
300*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglBindTexImage(dpy, surface, buffer);
301*38e8c45fSAndroid Build Coastguard Worker }
302*38e8c45fSAndroid Build Coastguard Worker 
eglReleaseTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)303*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) {
304*38e8c45fSAndroid Build Coastguard Worker     clearError();
305*38e8c45fSAndroid Build Coastguard Worker 
306*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
307*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglReleaseTexImage(dpy, surface, buffer);
308*38e8c45fSAndroid Build Coastguard Worker }
309*38e8c45fSAndroid Build Coastguard Worker 
eglSwapInterval(EGLDisplay dpy,EGLint interval)310*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) {
311*38e8c45fSAndroid Build Coastguard Worker     clearError();
312*38e8c45fSAndroid Build Coastguard Worker 
313*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
314*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSwapInterval(dpy, interval);
315*38e8c45fSAndroid Build Coastguard Worker }
316*38e8c45fSAndroid Build Coastguard Worker 
eglWaitClient(void)317*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglWaitClient(void) {
318*38e8c45fSAndroid Build Coastguard Worker     clearError();
319*38e8c45fSAndroid Build Coastguard Worker 
320*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
321*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglWaitClient();
322*38e8c45fSAndroid Build Coastguard Worker }
323*38e8c45fSAndroid Build Coastguard Worker 
eglBindAPI(EGLenum api)324*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglBindAPI(EGLenum api) {
325*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
326*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, (EGLBoolean)EGL_FALSE);
327*38e8c45fSAndroid Build Coastguard Worker     }
328*38e8c45fSAndroid Build Coastguard Worker 
329*38e8c45fSAndroid Build Coastguard Worker     clearError();
330*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
331*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglBindAPI(api);
332*38e8c45fSAndroid Build Coastguard Worker }
333*38e8c45fSAndroid Build Coastguard Worker 
eglQueryAPI(void)334*38e8c45fSAndroid Build Coastguard Worker EGLenum eglQueryAPI(void) {
335*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
336*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, (EGLBoolean)EGL_FALSE);
337*38e8c45fSAndroid Build Coastguard Worker     }
338*38e8c45fSAndroid Build Coastguard Worker 
339*38e8c45fSAndroid Build Coastguard Worker     clearError();
340*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
341*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryAPI();
342*38e8c45fSAndroid Build Coastguard Worker }
343*38e8c45fSAndroid Build Coastguard Worker 
eglReleaseThread(void)344*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglReleaseThread(void) {
345*38e8c45fSAndroid Build Coastguard Worker     clearError();
346*38e8c45fSAndroid Build Coastguard Worker 
347*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
348*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglReleaseThread();
349*38e8c45fSAndroid Build Coastguard Worker }
350*38e8c45fSAndroid Build Coastguard Worker 
eglCreatePbufferFromClientBuffer(EGLDisplay dpy,EGLenum buftype,EGLClientBuffer buffer,EGLConfig config,const EGLint * attrib_list)351*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
352*38e8c45fSAndroid Build Coastguard Worker                                             EGLConfig config, const EGLint* attrib_list) {
353*38e8c45fSAndroid Build Coastguard Worker     clearError();
354*38e8c45fSAndroid Build Coastguard Worker 
355*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
356*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config,
357*38e8c45fSAndroid Build Coastguard Worker                                                           attrib_list);
358*38e8c45fSAndroid Build Coastguard Worker }
359*38e8c45fSAndroid Build Coastguard Worker 
eglLockSurfaceKHR(EGLDisplay dpy,EGLSurface surface,const EGLint * attrib_list)360*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, const EGLint* attrib_list) {
361*38e8c45fSAndroid Build Coastguard Worker     clearError();
362*38e8c45fSAndroid Build Coastguard Worker 
363*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
364*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglLockSurfaceKHR(dpy, surface, attrib_list);
365*38e8c45fSAndroid Build Coastguard Worker }
366*38e8c45fSAndroid Build Coastguard Worker 
eglUnlockSurfaceKHR(EGLDisplay dpy,EGLSurface surface)367*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface) {
368*38e8c45fSAndroid Build Coastguard Worker     clearError();
369*38e8c45fSAndroid Build Coastguard Worker 
370*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
371*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglUnlockSurfaceKHR(dpy, surface);
372*38e8c45fSAndroid Build Coastguard Worker }
373*38e8c45fSAndroid Build Coastguard Worker 
eglCreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list)374*38e8c45fSAndroid Build Coastguard Worker EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
375*38e8c45fSAndroid Build Coastguard Worker                               EGLClientBuffer buffer, const EGLint* attrib_list) {
376*38e8c45fSAndroid Build Coastguard Worker     clearError();
377*38e8c45fSAndroid Build Coastguard Worker 
378*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
379*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
380*38e8c45fSAndroid Build Coastguard Worker }
381*38e8c45fSAndroid Build Coastguard Worker 
eglCreateImage(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLAttrib * attrib_list)382*38e8c45fSAndroid Build Coastguard Worker EGLImage eglCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer,
383*38e8c45fSAndroid Build Coastguard Worker                         const EGLAttrib* attrib_list) {
384*38e8c45fSAndroid Build Coastguard Worker     clearError();
385*38e8c45fSAndroid Build Coastguard Worker 
386*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
387*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateImage(dpy, ctx, target, buffer, attrib_list);
388*38e8c45fSAndroid Build Coastguard Worker }
389*38e8c45fSAndroid Build Coastguard Worker 
eglDestroyImageKHR(EGLDisplay dpy,EGLImageKHR img)390*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) {
391*38e8c45fSAndroid Build Coastguard Worker     clearError();
392*38e8c45fSAndroid Build Coastguard Worker 
393*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
394*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroyImageKHR(dpy, img);
395*38e8c45fSAndroid Build Coastguard Worker }
396*38e8c45fSAndroid Build Coastguard Worker 
eglDestroyImage(EGLDisplay dpy,EGLImageKHR img)397*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroyImage(EGLDisplay dpy, EGLImageKHR img) {
398*38e8c45fSAndroid Build Coastguard Worker     clearError();
399*38e8c45fSAndroid Build Coastguard Worker 
400*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
401*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroyImage(dpy, img);
402*38e8c45fSAndroid Build Coastguard Worker }
403*38e8c45fSAndroid Build Coastguard Worker 
404*38e8c45fSAndroid Build Coastguard Worker // ----------------------------------------------------------------------------
405*38e8c45fSAndroid Build Coastguard Worker // EGL_EGLEXT_VERSION 5
406*38e8c45fSAndroid Build Coastguard Worker // ----------------------------------------------------------------------------
407*38e8c45fSAndroid Build Coastguard Worker 
eglCreateSync(EGLDisplay dpy,EGLenum type,const EGLAttrib * attrib_list)408*38e8c45fSAndroid Build Coastguard Worker EGLSyncKHR eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib* attrib_list) {
409*38e8c45fSAndroid Build Coastguard Worker     clearError();
410*38e8c45fSAndroid Build Coastguard Worker 
411*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
412*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateSync(dpy, type, attrib_list);
413*38e8c45fSAndroid Build Coastguard Worker }
414*38e8c45fSAndroid Build Coastguard Worker 
eglCreateSyncKHR(EGLDisplay dpy,EGLenum type,const EGLint * attrib_list)415*38e8c45fSAndroid Build Coastguard Worker EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint* attrib_list) {
416*38e8c45fSAndroid Build Coastguard Worker     clearError();
417*38e8c45fSAndroid Build Coastguard Worker 
418*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
419*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateSyncKHR(dpy, type, attrib_list);
420*38e8c45fSAndroid Build Coastguard Worker }
421*38e8c45fSAndroid Build Coastguard Worker 
eglDestroySync(EGLDisplay dpy,EGLSyncKHR sync)422*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroySync(EGLDisplay dpy, EGLSyncKHR sync) {
423*38e8c45fSAndroid Build Coastguard Worker     clearError();
424*38e8c45fSAndroid Build Coastguard Worker 
425*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
426*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroySync(dpy, sync);
427*38e8c45fSAndroid Build Coastguard Worker }
428*38e8c45fSAndroid Build Coastguard Worker 
eglDestroySyncKHR(EGLDisplay dpy,EGLSyncKHR sync)429*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) {
430*38e8c45fSAndroid Build Coastguard Worker     clearError();
431*38e8c45fSAndroid Build Coastguard Worker 
432*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
433*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroySyncKHR(dpy, sync);
434*38e8c45fSAndroid Build Coastguard Worker }
435*38e8c45fSAndroid Build Coastguard Worker 
eglSignalSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLenum mode)436*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode) {
437*38e8c45fSAndroid Build Coastguard Worker     clearError();
438*38e8c45fSAndroid Build Coastguard Worker 
439*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
440*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSignalSyncKHR(dpy, sync, mode);
441*38e8c45fSAndroid Build Coastguard Worker }
442*38e8c45fSAndroid Build Coastguard Worker 
eglClientWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags,EGLTimeKHR timeout)443*38e8c45fSAndroid Build Coastguard Worker EGLint eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTimeKHR timeout) {
444*38e8c45fSAndroid Build Coastguard Worker     clearError();
445*38e8c45fSAndroid Build Coastguard Worker 
446*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
447*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglClientWaitSyncKHR(dpy, sync, flags, timeout);
448*38e8c45fSAndroid Build Coastguard Worker }
449*38e8c45fSAndroid Build Coastguard Worker 
eglClientWaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags,EGLTimeKHR timeout)450*38e8c45fSAndroid Build Coastguard Worker EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) {
451*38e8c45fSAndroid Build Coastguard Worker     clearError();
452*38e8c45fSAndroid Build Coastguard Worker 
453*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
454*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglClientWaitSyncKHR(dpy, sync, flags, timeout);
455*38e8c45fSAndroid Build Coastguard Worker }
456*38e8c45fSAndroid Build Coastguard Worker 
eglGetSyncAttrib(EGLDisplay dpy,EGLSync sync,EGLint attribute,EGLAttrib * value)457*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetSyncAttrib(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib* value) {
458*38e8c45fSAndroid Build Coastguard Worker     clearError();
459*38e8c45fSAndroid Build Coastguard Worker 
460*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
461*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetSyncAttrib(dpy, sync, attribute, value);
462*38e8c45fSAndroid Build Coastguard Worker }
463*38e8c45fSAndroid Build Coastguard Worker 
eglGetSyncAttribKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint attribute,EGLint * value)464*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint* value) {
465*38e8c45fSAndroid Build Coastguard Worker     clearError();
466*38e8c45fSAndroid Build Coastguard Worker 
467*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
468*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetSyncAttribKHR(dpy, sync, attribute, value);
469*38e8c45fSAndroid Build Coastguard Worker }
470*38e8c45fSAndroid Build Coastguard Worker 
eglCreateStreamKHR(EGLDisplay dpy,const EGLint * attrib_list)471*38e8c45fSAndroid Build Coastguard Worker EGLStreamKHR eglCreateStreamKHR(EGLDisplay dpy, const EGLint* attrib_list) {
472*38e8c45fSAndroid Build Coastguard Worker     clearError();
473*38e8c45fSAndroid Build Coastguard Worker 
474*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
475*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateStreamKHR(dpy, attrib_list);
476*38e8c45fSAndroid Build Coastguard Worker }
477*38e8c45fSAndroid Build Coastguard Worker 
eglDestroyStreamKHR(EGLDisplay dpy,EGLStreamKHR stream)478*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream) {
479*38e8c45fSAndroid Build Coastguard Worker     clearError();
480*38e8c45fSAndroid Build Coastguard Worker 
481*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
482*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDestroyStreamKHR(dpy, stream);
483*38e8c45fSAndroid Build Coastguard Worker }
484*38e8c45fSAndroid Build Coastguard Worker 
eglStreamAttribKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint value)485*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
486*38e8c45fSAndroid Build Coastguard Worker                               EGLint value) {
487*38e8c45fSAndroid Build Coastguard Worker     clearError();
488*38e8c45fSAndroid Build Coastguard Worker 
489*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
490*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglStreamAttribKHR(dpy, stream, attribute, value);
491*38e8c45fSAndroid Build Coastguard Worker }
492*38e8c45fSAndroid Build Coastguard Worker 
eglQueryStreamKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint * value)493*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
494*38e8c45fSAndroid Build Coastguard Worker                              EGLint* value) {
495*38e8c45fSAndroid Build Coastguard Worker     clearError();
496*38e8c45fSAndroid Build Coastguard Worker 
497*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
498*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryStreamKHR(dpy, stream, attribute, value);
499*38e8c45fSAndroid Build Coastguard Worker }
500*38e8c45fSAndroid Build Coastguard Worker 
eglQueryStreamu64KHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLuint64KHR * value)501*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
502*38e8c45fSAndroid Build Coastguard Worker                                 EGLuint64KHR* value) {
503*38e8c45fSAndroid Build Coastguard Worker     clearError();
504*38e8c45fSAndroid Build Coastguard Worker 
505*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
506*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryStreamu64KHR(dpy, stream, attribute, value);
507*38e8c45fSAndroid Build Coastguard Worker }
508*38e8c45fSAndroid Build Coastguard Worker 
eglQueryStreamTimeKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLTimeKHR * value)509*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
510*38e8c45fSAndroid Build Coastguard Worker                                  EGLTimeKHR* value) {
511*38e8c45fSAndroid Build Coastguard Worker     clearError();
512*38e8c45fSAndroid Build Coastguard Worker 
513*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
514*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglQueryStreamTimeKHR(dpy, stream, attribute, value);
515*38e8c45fSAndroid Build Coastguard Worker }
516*38e8c45fSAndroid Build Coastguard Worker 
eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy,EGLConfig config,EGLStreamKHR stream,const EGLint * attrib_list)517*38e8c45fSAndroid Build Coastguard Worker EGLSurface eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream,
518*38e8c45fSAndroid Build Coastguard Worker                                              const EGLint* attrib_list) {
519*38e8c45fSAndroid Build Coastguard Worker     clearError();
520*38e8c45fSAndroid Build Coastguard Worker 
521*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
522*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateStreamProducerSurfaceKHR(dpy, config, stream, attrib_list);
523*38e8c45fSAndroid Build Coastguard Worker }
524*38e8c45fSAndroid Build Coastguard Worker 
eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy,EGLStreamKHR stream)525*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream) {
526*38e8c45fSAndroid Build Coastguard Worker     clearError();
527*38e8c45fSAndroid Build Coastguard Worker 
528*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
529*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglStreamConsumerGLTextureExternalKHR(dpy, stream);
530*38e8c45fSAndroid Build Coastguard Worker }
531*38e8c45fSAndroid Build Coastguard Worker 
eglStreamConsumerAcquireKHR(EGLDisplay dpy,EGLStreamKHR stream)532*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream) {
533*38e8c45fSAndroid Build Coastguard Worker     clearError();
534*38e8c45fSAndroid Build Coastguard Worker 
535*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
536*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglStreamConsumerAcquireKHR(dpy, stream);
537*38e8c45fSAndroid Build Coastguard Worker }
538*38e8c45fSAndroid Build Coastguard Worker 
eglStreamConsumerReleaseKHR(EGLDisplay dpy,EGLStreamKHR stream)539*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream) {
540*38e8c45fSAndroid Build Coastguard Worker     clearError();
541*38e8c45fSAndroid Build Coastguard Worker 
542*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
543*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglStreamConsumerReleaseKHR(dpy, stream);
544*38e8c45fSAndroid Build Coastguard Worker }
545*38e8c45fSAndroid Build Coastguard Worker 
eglGetStreamFileDescriptorKHR(EGLDisplay dpy,EGLStreamKHR stream)546*38e8c45fSAndroid Build Coastguard Worker EGLNativeFileDescriptorKHR eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream) {
547*38e8c45fSAndroid Build Coastguard Worker     clearError();
548*38e8c45fSAndroid Build Coastguard Worker 
549*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
550*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetStreamFileDescriptorKHR(dpy, stream);
551*38e8c45fSAndroid Build Coastguard Worker }
552*38e8c45fSAndroid Build Coastguard Worker 
eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy,EGLNativeFileDescriptorKHR file_descriptor)553*38e8c45fSAndroid Build Coastguard Worker EGLStreamKHR eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy,
554*38e8c45fSAndroid Build Coastguard Worker                                                   EGLNativeFileDescriptorKHR file_descriptor) {
555*38e8c45fSAndroid Build Coastguard Worker     clearError();
556*38e8c45fSAndroid Build Coastguard Worker 
557*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
558*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglCreateStreamFromFileDescriptorKHR(dpy, file_descriptor);
559*38e8c45fSAndroid Build Coastguard Worker }
560*38e8c45fSAndroid Build Coastguard Worker 
eglWaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags)561*38e8c45fSAndroid Build Coastguard Worker EGLint eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) {
562*38e8c45fSAndroid Build Coastguard Worker     clearError();
563*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
564*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglWaitSyncKHR(dpy, sync, flags);
565*38e8c45fSAndroid Build Coastguard Worker }
566*38e8c45fSAndroid Build Coastguard Worker 
eglWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags)567*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags) {
568*38e8c45fSAndroid Build Coastguard Worker     clearError();
569*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
570*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglWaitSync(dpy, sync, flags);
571*38e8c45fSAndroid Build Coastguard Worker }
572*38e8c45fSAndroid Build Coastguard Worker 
eglDupNativeFenceFDANDROID(EGLDisplay dpy,EGLSyncKHR sync)573*38e8c45fSAndroid Build Coastguard Worker EGLint eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync) {
574*38e8c45fSAndroid Build Coastguard Worker     clearError();
575*38e8c45fSAndroid Build Coastguard Worker 
576*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
577*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglDupNativeFenceFDANDROID(dpy, sync);
578*38e8c45fSAndroid Build Coastguard Worker }
579*38e8c45fSAndroid Build Coastguard Worker 
eglPresentationTimeANDROID(EGLDisplay dpy,EGLSurface surface,EGLnsecsANDROID time)580*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time) {
581*38e8c45fSAndroid Build Coastguard Worker     clearError();
582*38e8c45fSAndroid Build Coastguard Worker 
583*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
584*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglPresentationTimeANDROID(dpy, surface, time);
585*38e8c45fSAndroid Build Coastguard Worker }
586*38e8c45fSAndroid Build Coastguard Worker 
eglGetNativeClientBufferANDROID(const AHardwareBuffer * buffer)587*38e8c45fSAndroid Build Coastguard Worker EGLClientBuffer eglGetNativeClientBufferANDROID(const AHardwareBuffer* buffer) {
588*38e8c45fSAndroid Build Coastguard Worker     clearError();
589*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
590*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetNativeClientBufferANDROID(buffer);
591*38e8c45fSAndroid Build Coastguard Worker }
592*38e8c45fSAndroid Build Coastguard Worker 
eglGetSystemTimeFrequencyNV()593*38e8c45fSAndroid Build Coastguard Worker EGLuint64NV eglGetSystemTimeFrequencyNV() {
594*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
595*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, (EGLuint64NV)EGL_FALSE);
596*38e8c45fSAndroid Build Coastguard Worker     }
597*38e8c45fSAndroid Build Coastguard Worker 
598*38e8c45fSAndroid Build Coastguard Worker     clearError();
599*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
600*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetSystemTimeFrequencyNV();
601*38e8c45fSAndroid Build Coastguard Worker }
602*38e8c45fSAndroid Build Coastguard Worker 
eglGetSystemTimeNV()603*38e8c45fSAndroid Build Coastguard Worker EGLuint64NV eglGetSystemTimeNV() {
604*38e8c45fSAndroid Build Coastguard Worker     if (egl_init_drivers() == EGL_FALSE) {
605*38e8c45fSAndroid Build Coastguard Worker         return setError(EGL_BAD_PARAMETER, (EGLuint64NV)EGL_FALSE);
606*38e8c45fSAndroid Build Coastguard Worker     }
607*38e8c45fSAndroid Build Coastguard Worker 
608*38e8c45fSAndroid Build Coastguard Worker     clearError();
609*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
610*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetSystemTimeNV();
611*38e8c45fSAndroid Build Coastguard Worker }
612*38e8c45fSAndroid Build Coastguard Worker 
eglSetDamageRegionKHR(EGLDisplay dpy,EGLSurface surface,EGLint * rects,EGLint n_rects)613*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglSetDamageRegionKHR(EGLDisplay dpy, EGLSurface surface, EGLint* rects,
614*38e8c45fSAndroid Build Coastguard Worker                                  EGLint n_rects) {
615*38e8c45fSAndroid Build Coastguard Worker     clearError();
616*38e8c45fSAndroid Build Coastguard Worker 
617*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
618*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglSetDamageRegionKHR(dpy, surface, rects, n_rects);
619*38e8c45fSAndroid Build Coastguard Worker }
620*38e8c45fSAndroid Build Coastguard Worker 
eglGetNextFrameIdANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * frameId)621*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetNextFrameIdANDROID(EGLDisplay dpy, EGLSurface surface, EGLuint64KHR* frameId) {
622*38e8c45fSAndroid Build Coastguard Worker     clearError();
623*38e8c45fSAndroid Build Coastguard Worker 
624*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
625*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetNextFrameIdANDROID(dpy, surface, frameId);
626*38e8c45fSAndroid Build Coastguard Worker }
627*38e8c45fSAndroid Build Coastguard Worker 
eglGetCompositorTimingANDROID(EGLDisplay dpy,EGLSurface surface,EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values)628*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetCompositorTimingANDROID(EGLDisplay dpy, EGLSurface surface, EGLint numTimestamps,
629*38e8c45fSAndroid Build Coastguard Worker                                          const EGLint* names, EGLnsecsANDROID* values) {
630*38e8c45fSAndroid Build Coastguard Worker     clearError();
631*38e8c45fSAndroid Build Coastguard Worker 
632*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
633*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetCompositorTimingANDROID(dpy, surface, numTimestamps, names, values);
634*38e8c45fSAndroid Build Coastguard Worker }
635*38e8c45fSAndroid Build Coastguard Worker 
eglGetCompositorTimingSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint name)636*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetCompositorTimingSupportedANDROID(EGLDisplay dpy, EGLSurface surface, EGLint name) {
637*38e8c45fSAndroid Build Coastguard Worker     clearError();
638*38e8c45fSAndroid Build Coastguard Worker 
639*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
640*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetCompositorTimingSupportedANDROID(dpy, surface, name);
641*38e8c45fSAndroid Build Coastguard Worker }
642*38e8c45fSAndroid Build Coastguard Worker 
eglGetFrameTimestampsANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values)643*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetFrameTimestampsANDROID(EGLDisplay dpy, EGLSurface surface, EGLuint64KHR frameId,
644*38e8c45fSAndroid Build Coastguard Worker                                         EGLint numTimestamps, const EGLint* timestamps,
645*38e8c45fSAndroid Build Coastguard Worker                                         EGLnsecsANDROID* values) {
646*38e8c45fSAndroid Build Coastguard Worker     clearError();
647*38e8c45fSAndroid Build Coastguard Worker 
648*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
649*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetFrameTimestampsANDROID(dpy, surface, frameId, numTimestamps,
650*38e8c45fSAndroid Build Coastguard Worker                                                       timestamps, values);
651*38e8c45fSAndroid Build Coastguard Worker }
652*38e8c45fSAndroid Build Coastguard Worker 
eglGetFrameTimestampSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint timestamp)653*38e8c45fSAndroid Build Coastguard Worker EGLBoolean eglGetFrameTimestampSupportedANDROID(EGLDisplay dpy, EGLSurface surface,
654*38e8c45fSAndroid Build Coastguard Worker                                                 EGLint timestamp) {
655*38e8c45fSAndroid Build Coastguard Worker     clearError();
656*38e8c45fSAndroid Build Coastguard Worker 
657*38e8c45fSAndroid Build Coastguard Worker     egl_connection_t* const cnx = &gEGLImpl;
658*38e8c45fSAndroid Build Coastguard Worker     return cnx->platform.eglGetFrameTimestampSupportedANDROID(dpy, surface, timestamp);
659*38e8c45fSAndroid Build Coastguard Worker }
660