1 //
2 // Copyright 2002 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 // libEGL.cpp: Implements the exported EGL functions.
8
9 #include "anglebase/no_destructor.h"
10 #include "common/system_utils.h"
11
12 #include <memory>
13
14 #if defined(ANGLE_USE_EGL_LOADER)
15 # include "libEGL/egl_loader_autogen.h"
16 #else
17 # include "libGLESv2/entry_points_egl.h"
18 # include "libGLESv2/entry_points_egl_ext.h"
19 #endif // defined(ANGLE_USE_EGL_LOADER)
20
21 namespace
22 {
23 #if defined(ANGLE_USE_EGL_LOADER)
24 bool gLoaded = false;
25
EntryPointsLib()26 std::unique_ptr<angle::Library> &EntryPointsLib()
27 {
28 static angle::base::NoDestructor<std::unique_ptr<angle::Library>> entryPointsLib;
29 return *entryPointsLib;
30 }
31
GlobalLoad(const char * symbol)32 angle::GenericProc KHRONOS_APIENTRY GlobalLoad(const char *symbol)
33 {
34 return reinterpret_cast<angle::GenericProc>(EntryPointsLib()->getSymbol(symbol));
35 }
36
EnsureEGLLoaded()37 void EnsureEGLLoaded()
38 {
39 if (gLoaded)
40 return;
41
42 EntryPointsLib().reset(
43 angle::OpenSharedLibrary(ANGLE_GLESV2_LIBRARY_NAME, angle::SearchType::ApplicationDir));
44 angle::LoadEGL_EGL(GlobalLoad);
45 if (!EGL_GetPlatformDisplay)
46 {
47 fprintf(stderr, "Error loading EGL entry points.\n");
48 }
49 else
50 {
51 gLoaded = true;
52 }
53 }
54 #else
55 void EnsureEGLLoaded() {}
56 #endif // defined(ANGLE_USE_EGL_LOADER)
57 } // anonymous namespace
58
59 extern "C" {
60
eglChooseConfig(EGLDisplay dpy,const EGLint * attrib_list,EGLConfig * configs,EGLint config_size,EGLint * num_config)61 EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy,
62 const EGLint *attrib_list,
63 EGLConfig *configs,
64 EGLint config_size,
65 EGLint *num_config)
66 {
67 EnsureEGLLoaded();
68 return EGL_ChooseConfig(dpy, attrib_list, configs, config_size, num_config);
69 }
70
eglCopyBuffers(EGLDisplay dpy,EGLSurface surface,EGLNativePixmapType target)71 EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy,
72 EGLSurface surface,
73 EGLNativePixmapType target)
74 {
75 EnsureEGLLoaded();
76 return EGL_CopyBuffers(dpy, surface, target);
77 }
78
eglCreateContext(EGLDisplay dpy,EGLConfig config,EGLContext share_context,const EGLint * attrib_list)79 EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy,
80 EGLConfig config,
81 EGLContext share_context,
82 const EGLint *attrib_list)
83 {
84 EnsureEGLLoaded();
85 return EGL_CreateContext(dpy, config, share_context, attrib_list);
86 }
87
eglCreatePbufferSurface(EGLDisplay dpy,EGLConfig config,const EGLint * attrib_list)88 EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy,
89 EGLConfig config,
90 const EGLint *attrib_list)
91 {
92 EnsureEGLLoaded();
93 return EGL_CreatePbufferSurface(dpy, config, attrib_list);
94 }
95
eglCreatePixmapSurface(EGLDisplay dpy,EGLConfig config,EGLNativePixmapType pixmap,const EGLint * attrib_list)96 EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy,
97 EGLConfig config,
98 EGLNativePixmapType pixmap,
99 const EGLint *attrib_list)
100 {
101 EnsureEGLLoaded();
102 return EGL_CreatePixmapSurface(dpy, config, pixmap, attrib_list);
103 }
104
eglCreateWindowSurface(EGLDisplay dpy,EGLConfig config,EGLNativeWindowType win,const EGLint * attrib_list)105 EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy,
106 EGLConfig config,
107 EGLNativeWindowType win,
108 const EGLint *attrib_list)
109 {
110 EnsureEGLLoaded();
111 return EGL_CreateWindowSurface(dpy, config, win, attrib_list);
112 }
113
eglDestroyContext(EGLDisplay dpy,EGLContext ctx)114 EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
115 {
116 EnsureEGLLoaded();
117 return EGL_DestroyContext(dpy, ctx);
118 }
119
eglDestroySurface(EGLDisplay dpy,EGLSurface surface)120 EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
121 {
122 EnsureEGLLoaded();
123 return EGL_DestroySurface(dpy, surface);
124 }
125
eglGetConfigAttrib(EGLDisplay dpy,EGLConfig config,EGLint attribute,EGLint * value)126 EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy,
127 EGLConfig config,
128 EGLint attribute,
129 EGLint *value)
130 {
131 EnsureEGLLoaded();
132 return EGL_GetConfigAttrib(dpy, config, attribute, value);
133 }
134
eglGetConfigs(EGLDisplay dpy,EGLConfig * configs,EGLint config_size,EGLint * num_config)135 EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy,
136 EGLConfig *configs,
137 EGLint config_size,
138 EGLint *num_config)
139 {
140 EnsureEGLLoaded();
141 return EGL_GetConfigs(dpy, configs, config_size, num_config);
142 }
143
eglGetCurrentDisplay(void)144 EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void)
145 {
146 EnsureEGLLoaded();
147 return EGL_GetCurrentDisplay();
148 }
149
eglGetCurrentSurface(EGLint readdraw)150 EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw)
151 {
152 EnsureEGLLoaded();
153 return EGL_GetCurrentSurface(readdraw);
154 }
155
eglGetDisplay(EGLNativeDisplayType display_id)156 EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
157 {
158 EnsureEGLLoaded();
159 return EGL_GetDisplay(display_id);
160 }
161
eglGetError(void)162 EGLint EGLAPIENTRY eglGetError(void)
163 {
164 EnsureEGLLoaded();
165 return EGL_GetError();
166 }
167
eglInitialize(EGLDisplay dpy,EGLint * major,EGLint * minor)168 EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
169 {
170 EnsureEGLLoaded();
171 return EGL_Initialize(dpy, major, minor);
172 }
173
eglMakeCurrent(EGLDisplay dpy,EGLSurface draw,EGLSurface read,EGLContext ctx)174 EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy,
175 EGLSurface draw,
176 EGLSurface read,
177 EGLContext ctx)
178 {
179 EnsureEGLLoaded();
180 return EGL_MakeCurrent(dpy, draw, read, ctx);
181 }
182
eglQueryContext(EGLDisplay dpy,EGLContext ctx,EGLint attribute,EGLint * value)183 EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy,
184 EGLContext ctx,
185 EGLint attribute,
186 EGLint *value)
187 {
188 EnsureEGLLoaded();
189 return EGL_QueryContext(dpy, ctx, attribute, value);
190 }
191
eglQueryString(EGLDisplay dpy,EGLint name)192 const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name)
193 {
194 EnsureEGLLoaded();
195 return EGL_QueryString(dpy, name);
196 }
197
eglQuerySurface(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint * value)198 EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy,
199 EGLSurface surface,
200 EGLint attribute,
201 EGLint *value)
202 {
203 EnsureEGLLoaded();
204 return EGL_QuerySurface(dpy, surface, attribute, value);
205 }
206
eglSwapBuffers(EGLDisplay dpy,EGLSurface surface)207 EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
208 {
209 EnsureEGLLoaded();
210 return EGL_SwapBuffers(dpy, surface);
211 }
212
eglTerminate(EGLDisplay dpy)213 EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
214 {
215 EnsureEGLLoaded();
216 return EGL_Terminate(dpy);
217 }
218
eglWaitGL(void)219 EGLBoolean EGLAPIENTRY eglWaitGL(void)
220 {
221 EnsureEGLLoaded();
222 return EGL_WaitGL();
223 }
224
eglWaitNative(EGLint engine)225 EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine)
226 {
227 EnsureEGLLoaded();
228 return EGL_WaitNative(engine);
229 }
230
eglBindTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)231 EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
232 {
233 EnsureEGLLoaded();
234 return EGL_BindTexImage(dpy, surface, buffer);
235 }
236
eglReleaseTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)237 EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
238 {
239 EnsureEGLLoaded();
240 return EGL_ReleaseTexImage(dpy, surface, buffer);
241 }
242
eglSurfaceAttrib(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint value)243 EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy,
244 EGLSurface surface,
245 EGLint attribute,
246 EGLint value)
247 {
248 EnsureEGLLoaded();
249 return EGL_SurfaceAttrib(dpy, surface, attribute, value);
250 }
251
eglSwapInterval(EGLDisplay dpy,EGLint interval)252 EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
253 {
254 EnsureEGLLoaded();
255 return EGL_SwapInterval(dpy, interval);
256 }
257
eglBindAPI(EGLenum api)258 EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api)
259 {
260 EnsureEGLLoaded();
261 return EGL_BindAPI(api);
262 }
263
eglQueryAPI(void)264 EGLenum EGLAPIENTRY eglQueryAPI(void)
265 {
266 EnsureEGLLoaded();
267 return EGL_QueryAPI();
268 }
269
eglCreatePbufferFromClientBuffer(EGLDisplay dpy,EGLenum buftype,EGLClientBuffer buffer,EGLConfig config,const EGLint * attrib_list)270 EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy,
271 EGLenum buftype,
272 EGLClientBuffer buffer,
273 EGLConfig config,
274 const EGLint *attrib_list)
275 {
276 EnsureEGLLoaded();
277 return EGL_CreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
278 }
279
eglReleaseThread(void)280 EGLBoolean EGLAPIENTRY eglReleaseThread(void)
281 {
282 EnsureEGLLoaded();
283 return EGL_ReleaseThread();
284 }
285
eglWaitClient(void)286 EGLBoolean EGLAPIENTRY eglWaitClient(void)
287 {
288 EnsureEGLLoaded();
289 return EGL_WaitClient();
290 }
291
eglGetCurrentContext(void)292 EGLContext EGLAPIENTRY eglGetCurrentContext(void)
293 {
294 EnsureEGLLoaded();
295 return EGL_GetCurrentContext();
296 }
297
eglCreateSync(EGLDisplay dpy,EGLenum type,const EGLAttrib * attrib_list)298 EGLSync EGLAPIENTRY eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
299 {
300 EnsureEGLLoaded();
301 return EGL_CreateSync(dpy, type, attrib_list);
302 }
303
eglDestroySync(EGLDisplay dpy,EGLSync sync)304 EGLBoolean EGLAPIENTRY eglDestroySync(EGLDisplay dpy, EGLSync sync)
305 {
306 EnsureEGLLoaded();
307 return EGL_DestroySync(dpy, sync);
308 }
309
eglClientWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags,EGLTime timeout)310 EGLint EGLAPIENTRY eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
311 {
312 EnsureEGLLoaded();
313 return EGL_ClientWaitSync(dpy, sync, flags, timeout);
314 }
315
eglGetSyncAttrib(EGLDisplay dpy,EGLSync sync,EGLint attribute,EGLAttrib * value)316 EGLBoolean EGLAPIENTRY eglGetSyncAttrib(EGLDisplay dpy,
317 EGLSync sync,
318 EGLint attribute,
319 EGLAttrib *value)
320 {
321 EnsureEGLLoaded();
322 return EGL_GetSyncAttrib(dpy, sync, attribute, value);
323 }
324
eglCreateImage(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLAttrib * attrib_list)325 EGLImage EGLAPIENTRY eglCreateImage(EGLDisplay dpy,
326 EGLContext ctx,
327 EGLenum target,
328 EGLClientBuffer buffer,
329 const EGLAttrib *attrib_list)
330 {
331 EnsureEGLLoaded();
332 return EGL_CreateImage(dpy, ctx, target, buffer, attrib_list);
333 }
334
eglDestroyImage(EGLDisplay dpy,EGLImage image)335 EGLBoolean EGLAPIENTRY eglDestroyImage(EGLDisplay dpy, EGLImage image)
336 {
337 EnsureEGLLoaded();
338 return EGL_DestroyImage(dpy, image);
339 }
340
eglGetPlatformDisplay(EGLenum platform,void * native_display,const EGLAttrib * attrib_list)341 EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform,
342 void *native_display,
343 const EGLAttrib *attrib_list)
344 {
345 EnsureEGLLoaded();
346 return EGL_GetPlatformDisplay(platform, native_display, attrib_list);
347 }
348
eglCreatePlatformWindowSurface(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLAttrib * attrib_list)349 EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface(EGLDisplay dpy,
350 EGLConfig config,
351 void *native_window,
352 const EGLAttrib *attrib_list)
353 {
354 EnsureEGLLoaded();
355 return EGL_CreatePlatformWindowSurface(dpy, config, native_window, attrib_list);
356 }
357
eglCreatePlatformPixmapSurface(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLAttrib * attrib_list)358 EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface(EGLDisplay dpy,
359 EGLConfig config,
360 void *native_pixmap,
361 const EGLAttrib *attrib_list)
362 {
363 EnsureEGLLoaded();
364 return EGL_CreatePlatformPixmapSurface(dpy, config, native_pixmap, attrib_list);
365 }
366
eglWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags)367 EGLBoolean EGLAPIENTRY eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags)
368 {
369 EnsureEGLLoaded();
370 return EGL_WaitSync(dpy, sync, flags);
371 }
372
eglQuerySurfacePointerANGLE(EGLDisplay dpy,EGLSurface surface,EGLint attribute,void ** value)373 EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE(EGLDisplay dpy,
374 EGLSurface surface,
375 EGLint attribute,
376 void **value)
377 {
378 EnsureEGLLoaded();
379 return EGL_QuerySurfacePointerANGLE(dpy, surface, attribute, value);
380 }
381
eglPostSubBufferNV(EGLDisplay dpy,EGLSurface surface,EGLint x,EGLint y,EGLint width,EGLint height)382 EGLBoolean EGLAPIENTRY eglPostSubBufferNV(EGLDisplay dpy,
383 EGLSurface surface,
384 EGLint x,
385 EGLint y,
386 EGLint width,
387 EGLint height)
388 {
389 EnsureEGLLoaded();
390 return EGL_PostSubBufferNV(dpy, surface, x, y, width, height);
391 }
392
eglGetPlatformDisplayEXT(EGLenum platform,void * native_display,const EGLint * attrib_list)393 EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT(EGLenum platform,
394 void *native_display,
395 const EGLint *attrib_list)
396 {
397 EnsureEGLLoaded();
398 return EGL_GetPlatformDisplayEXT(platform, native_display, attrib_list);
399 }
400
eglCreatePlatformWindowSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLint * attrib_list)401 EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
402 EGLConfig config,
403 void *native_window,
404 const EGLint *attrib_list)
405 {
406 EnsureEGLLoaded();
407 return EGL_CreatePlatformWindowSurfaceEXT(dpy, config, native_window, attrib_list);
408 }
409
eglCreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLint * attrib_list)410 EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,
411 EGLConfig config,
412 void *native_pixmap,
413 const EGLint *attrib_list)
414 {
415 EnsureEGLLoaded();
416 return EGL_CreatePlatformPixmapSurfaceEXT(dpy, config, native_pixmap, attrib_list);
417 }
418
eglQueryDisplayAttribEXT(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)419 EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
420 {
421 EnsureEGLLoaded();
422 return EGL_QueryDisplayAttribEXT(dpy, attribute, value);
423 }
424
eglQueryDisplayAttribANGLE(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)425 EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy,
426 EGLint attribute,
427 EGLAttrib *value)
428 {
429 EnsureEGLLoaded();
430 return EGL_QueryDisplayAttribANGLE(dpy, attribute, value);
431 }
432
eglQueryDeviceAttribEXT(EGLDeviceEXT device,EGLint attribute,EGLAttrib * value)433 EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device,
434 EGLint attribute,
435 EGLAttrib *value)
436 {
437 EnsureEGLLoaded();
438 return EGL_QueryDeviceAttribEXT(device, attribute, value);
439 }
440
eglQueryDeviceStringEXT(EGLDeviceEXT device,EGLint name)441 const char *EGLAPIENTRY eglQueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
442 {
443 EnsureEGLLoaded();
444 return EGL_QueryDeviceStringEXT(device, name);
445 }
446
eglCreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list)447 EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay dpy,
448 EGLContext ctx,
449 EGLenum target,
450 EGLClientBuffer buffer,
451 const EGLint *attrib_list)
452 {
453 EnsureEGLLoaded();
454 return EGL_CreateImageKHR(dpy, ctx, target, buffer, attrib_list);
455 }
456
eglDestroyImageKHR(EGLDisplay dpy,EGLImageKHR image)457 EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
458 {
459 EnsureEGLLoaded();
460 return EGL_DestroyImageKHR(dpy, image);
461 }
462
eglCreateDeviceANGLE(EGLint device_type,void * native_device,const EGLAttrib * attrib_list)463 EGLDeviceEXT EGLAPIENTRY eglCreateDeviceANGLE(EGLint device_type,
464 void *native_device,
465 const EGLAttrib *attrib_list)
466 {
467 EnsureEGLLoaded();
468 return EGL_CreateDeviceANGLE(device_type, native_device, attrib_list);
469 }
470
eglReleaseDeviceANGLE(EGLDeviceEXT device)471 EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device)
472 {
473 EnsureEGLLoaded();
474 return EGL_ReleaseDeviceANGLE(device);
475 }
476
eglGetProcAddress(const char * procname)477 __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
478 {
479 EnsureEGLLoaded();
480 return EGL_GetProcAddress(procname);
481 }
482
eglCreateStreamKHR(EGLDisplay dpy,const EGLint * attrib_list)483 EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
484 {
485 EnsureEGLLoaded();
486 return EGL_CreateStreamKHR(dpy, attrib_list);
487 }
488
eglDestroyStreamKHR(EGLDisplay dpy,EGLStreamKHR stream)489 EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
490 {
491 EnsureEGLLoaded();
492 return EGL_DestroyStreamKHR(dpy, stream);
493 }
494
eglStreamAttribKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint value)495 EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy,
496 EGLStreamKHR stream,
497 EGLenum attribute,
498 EGLint value)
499 {
500 EnsureEGLLoaded();
501 return EGL_StreamAttribKHR(dpy, stream, attribute, value);
502 }
503
eglQueryStreamKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint * value)504 EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy,
505 EGLStreamKHR stream,
506 EGLenum attribute,
507 EGLint *value)
508 {
509 EnsureEGLLoaded();
510 return EGL_QueryStreamKHR(dpy, stream, attribute, value);
511 }
512
eglQueryStreamu64KHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLuint64KHR * value)513 EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy,
514 EGLStreamKHR stream,
515 EGLenum attribute,
516 EGLuint64KHR *value)
517 {
518 EnsureEGLLoaded();
519 return EGL_QueryStreamu64KHR(dpy, stream, attribute, value);
520 }
521
eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy,EGLStreamKHR stream)522 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
523 {
524 EnsureEGLLoaded();
525 return EGL_StreamConsumerGLTextureExternalKHR(dpy, stream);
526 }
527
eglStreamConsumerAcquireKHR(EGLDisplay dpy,EGLStreamKHR stream)528 EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
529 {
530 EnsureEGLLoaded();
531 return EGL_StreamConsumerAcquireKHR(dpy, stream);
532 }
533
eglStreamConsumerReleaseKHR(EGLDisplay dpy,EGLStreamKHR stream)534 EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
535 {
536 EnsureEGLLoaded();
537 return EGL_StreamConsumerReleaseKHR(dpy, stream);
538 }
539
eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)540 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
541 EGLStreamKHR stream,
542 const EGLAttrib *attrib_list)
543 {
544 EnsureEGLLoaded();
545 return EGL_StreamConsumerGLTextureExternalAttribsNV(dpy, stream, attrib_list);
546 }
547
eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)548 EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
549 EGLStreamKHR stream,
550 const EGLAttrib *attrib_list)
551 {
552 EnsureEGLLoaded();
553 return EGL_CreateStreamProducerD3DTextureANGLE(dpy, stream, attrib_list);
554 }
555
eglStreamPostD3DTextureANGLE(EGLDisplay dpy,EGLStreamKHR stream,void * texture,const EGLAttrib * attrib_list)556 EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
557 EGLStreamKHR stream,
558 void *texture,
559 const EGLAttrib *attrib_list)
560 {
561 EnsureEGLLoaded();
562 return EGL_StreamPostD3DTextureANGLE(dpy, stream, texture, attrib_list);
563 }
564
eglGetSyncValuesCHROMIUM(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * ust,EGLuint64KHR * msc,EGLuint64KHR * sbc)565 EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
566 EGLSurface surface,
567 EGLuint64KHR *ust,
568 EGLuint64KHR *msc,
569 EGLuint64KHR *sbc)
570 {
571 EnsureEGLLoaded();
572 return EGL_GetSyncValuesCHROMIUM(dpy, surface, ust, msc, sbc);
573 }
574
eglGetMscRateANGLE(EGLDisplay dpy,EGLSurface surface,EGLint * numerator,EGLint * denominator)575 EGLBoolean EGLAPIENTRY eglGetMscRateANGLE(EGLDisplay dpy,
576 EGLSurface surface,
577 EGLint *numerator,
578 EGLint *denominator)
579 {
580 EnsureEGLLoaded();
581 return EGL_GetMscRateANGLE(dpy, surface, numerator, denominator);
582 }
583
eglSwapBuffersWithDamageKHR(EGLDisplay dpy,EGLSurface surface,EGLint * rects,EGLint n_rects)584 EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR(EGLDisplay dpy,
585 EGLSurface surface,
586 EGLint *rects,
587 EGLint n_rects)
588 {
589 EnsureEGLLoaded();
590 return EGL_SwapBuffersWithDamageKHR(dpy, surface, rects, n_rects);
591 }
592
eglPresentationTimeANDROID(EGLDisplay dpy,EGLSurface surface,EGLnsecsANDROID time)593 EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID(EGLDisplay dpy,
594 EGLSurface surface,
595 EGLnsecsANDROID time)
596 {
597 EnsureEGLLoaded();
598 return EGL_PresentationTimeANDROID(dpy, surface, time);
599 }
600
eglProgramCacheGetAttribANGLE(EGLDisplay dpy,EGLenum attrib)601 EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib)
602 {
603 EnsureEGLLoaded();
604 return EGL_ProgramCacheGetAttribANGLE(dpy, attrib);
605 }
606
eglProgramCacheQueryANGLE(EGLDisplay dpy,EGLint index,void * key,EGLint * keysize,void * binary,EGLint * binarysize)607 void EGLAPIENTRY eglProgramCacheQueryANGLE(EGLDisplay dpy,
608 EGLint index,
609 void *key,
610 EGLint *keysize,
611 void *binary,
612 EGLint *binarysize)
613 {
614 EGL_ProgramCacheQueryANGLE(dpy, index, key, keysize, binary, binarysize);
615 }
616
eglProgramCachePopulateANGLE(EGLDisplay dpy,const void * key,EGLint keysize,const void * binary,EGLint binarysize)617 void EGLAPIENTRY eglProgramCachePopulateANGLE(EGLDisplay dpy,
618 const void *key,
619 EGLint keysize,
620 const void *binary,
621 EGLint binarysize)
622 {
623 EGL_ProgramCachePopulateANGLE(dpy, key, keysize, binary, binarysize);
624 }
625
eglProgramCacheResizeANGLE(EGLDisplay dpy,EGLint limit,EGLenum mode)626 EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLenum mode)
627 {
628 EnsureEGLLoaded();
629 return EGL_ProgramCacheResizeANGLE(dpy, limit, mode);
630 }
631
eglDebugMessageControlKHR(EGLDEBUGPROCKHR callback,const EGLAttrib * attrib_list)632 EGLint EGLAPIENTRY eglDebugMessageControlKHR(EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list)
633 {
634 EnsureEGLLoaded();
635 return EGL_DebugMessageControlKHR(callback, attrib_list);
636 }
637
eglQueryDebugKHR(EGLint attribute,EGLAttrib * value)638 EGLBoolean EGLAPIENTRY eglQueryDebugKHR(EGLint attribute, EGLAttrib *value)
639 {
640 EnsureEGLLoaded();
641 return EGL_QueryDebugKHR(attribute, value);
642 }
643
eglLabelObjectKHR(EGLDisplay dpy,EGLenum objectType,EGLObjectKHR object,EGLLabelKHR label)644 EGLint EGLAPIENTRY eglLabelObjectKHR(EGLDisplay dpy,
645 EGLenum objectType,
646 EGLObjectKHR object,
647 EGLLabelKHR label)
648 {
649 EnsureEGLLoaded();
650 return EGL_LabelObjectKHR(dpy, objectType, object, label);
651 }
652
eglSetBlobCacheFuncsANDROID(EGLDisplay dpy,EGLSetBlobFuncANDROID set,EGLGetBlobFuncANDROID get)653 void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy,
654 EGLSetBlobFuncANDROID set,
655 EGLGetBlobFuncANDROID get)
656 {
657 EnsureEGLLoaded();
658 return EGL_SetBlobCacheFuncsANDROID(dpy, set, get);
659 }
660
eglGetCompositorTimingSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint name)661 EGLBoolean EGLAPIENTRY eglGetCompositorTimingSupportedANDROID(EGLDisplay dpy,
662 EGLSurface surface,
663 EGLint name)
664 {
665 EnsureEGLLoaded();
666 return EGL_GetCompositorTimingSupportedANDROID(dpy, surface, name);
667 }
668
eglGetCompositorTimingANDROID(EGLDisplay dpy,EGLSurface surface,EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values)669 EGLBoolean EGLAPIENTRY eglGetCompositorTimingANDROID(EGLDisplay dpy,
670 EGLSurface surface,
671 EGLint numTimestamps,
672 const EGLint *names,
673 EGLnsecsANDROID *values)
674 {
675 EnsureEGLLoaded();
676 return EGL_GetCompositorTimingANDROID(dpy, surface, numTimestamps, names, values);
677 }
678
eglGetNextFrameIdANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * frameId)679 EGLBoolean EGLAPIENTRY eglGetNextFrameIdANDROID(EGLDisplay dpy,
680 EGLSurface surface,
681 EGLuint64KHR *frameId)
682 {
683 EnsureEGLLoaded();
684 return EGL_GetNextFrameIdANDROID(dpy, surface, frameId);
685 }
686
eglGetFrameTimestampSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint timestamp)687 EGLBoolean EGLAPIENTRY eglGetFrameTimestampSupportedANDROID(EGLDisplay dpy,
688 EGLSurface surface,
689 EGLint timestamp)
690 {
691 EnsureEGLLoaded();
692 return EGL_GetFrameTimestampSupportedANDROID(dpy, surface, timestamp);
693 }
694
eglGetFrameTimestampsANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values)695 EGLBoolean EGLAPIENTRY eglGetFrameTimestampsANDROID(EGLDisplay dpy,
696 EGLSurface surface,
697 EGLuint64KHR frameId,
698 EGLint numTimestamps,
699 const EGLint *timestamps,
700 EGLnsecsANDROID *values)
701 {
702 EnsureEGLLoaded();
703 return EGL_GetFrameTimestampsANDROID(dpy, surface, frameId, numTimestamps, timestamps, values);
704 }
705
eglQueryStringiANGLE(EGLDisplay dpy,EGLint name,EGLint index)706 const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index)
707 {
708 EnsureEGLLoaded();
709 return EGL_QueryStringiANGLE(dpy, name, index);
710 }
711
eglGetNativeClientBufferANDROID(const struct AHardwareBuffer * buffer)712 EGLClientBuffer EGLAPIENTRY eglGetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer)
713 {
714 EnsureEGLLoaded();
715 return EGL_GetNativeClientBufferANDROID(buffer);
716 }
717
eglDupNativeFenceFDANDROID(EGLDisplay dpy,EGLSyncKHR sync)718 EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
719 {
720 EnsureEGLLoaded();
721 return EGL_DupNativeFenceFDANDROID(dpy, sync);
722 }
723
eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,EGLSurface surface,EGLFrameTokenANGLE frametoken)724 EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
725 EGLSurface surface,
726 EGLFrameTokenANGLE frametoken)
727 {
728 EnsureEGLLoaded();
729 return EGL_SwapBuffersWithFrameTokenANGLE(dpy, surface, frametoken);
730 }
731
eglCreateSyncKHR(EGLDisplay dpy,EGLenum type,const EGLint * attrib_list)732 EGLSync EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
733 {
734 EnsureEGLLoaded();
735 return EGL_CreateSyncKHR(dpy, type, attrib_list);
736 }
737
eglDestroySyncKHR(EGLDisplay dpy,EGLSync sync)738 EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSync sync)
739 {
740 EnsureEGLLoaded();
741 return EGL_DestroySyncKHR(dpy, sync);
742 }
743
eglClientWaitSyncKHR(EGLDisplay dpy,EGLSync sync,EGLint flags,EGLTime timeout)744 EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
745 {
746 EnsureEGLLoaded();
747 return EGL_ClientWaitSyncKHR(dpy, sync, flags, timeout);
748 }
749
eglGetSyncAttribKHR(EGLDisplay dpy,EGLSync sync,EGLint attribute,EGLint * value)750 EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy,
751 EGLSync sync,
752 EGLint attribute,
753 EGLint *value)
754 {
755 EnsureEGLLoaded();
756 return EGL_GetSyncAttribKHR(dpy, sync, attribute, value);
757 }
758
eglWaitSyncKHR(EGLDisplay dpy,EGLSync sync,EGLint flags)759 EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSync sync, EGLint flags)
760 {
761 EnsureEGLLoaded();
762 return EGL_WaitSyncKHR(dpy, sync, flags);
763 }
764
765 } // extern "C"
766