1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // ui/gl/generate_bindings.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
13 #include "base/trace_event/trace_event.h"
14 #include "ui/gl/gl_bindings.h"
15 #include "ui/gl/gl_context.h"
16 #include "ui/gl/gl_egl_api_implementation.h"
17 #include "ui/gl/gl_enums.h"
18 #include "ui/gl/gl_implementation.h"
19 #include "ui/gl/gl_version_info.h"
23 static bool g_debugBindingsInitialized
;
24 DriverEGL g_driver_egl
;
26 void DriverEGL::InitializeStaticBindings() {
28 reinterpret_cast<eglBindAPIProc
>(GetGLProcAddress("eglBindAPI"));
29 fn
.eglBindTexImageFn
= reinterpret_cast<eglBindTexImageProc
>(
30 GetGLProcAddress("eglBindTexImage"));
31 fn
.eglChooseConfigFn
= reinterpret_cast<eglChooseConfigProc
>(
32 GetGLProcAddress("eglChooseConfig"));
33 fn
.eglClientWaitSyncKHRFn
= 0;
35 reinterpret_cast<eglCopyBuffersProc
>(GetGLProcAddress("eglCopyBuffers"));
36 fn
.eglCreateContextFn
= reinterpret_cast<eglCreateContextProc
>(
37 GetGLProcAddress("eglCreateContext"));
38 fn
.eglCreateImageKHRFn
= 0;
39 fn
.eglCreatePbufferFromClientBufferFn
=
40 reinterpret_cast<eglCreatePbufferFromClientBufferProc
>(
41 GetGLProcAddress("eglCreatePbufferFromClientBuffer"));
42 fn
.eglCreatePbufferSurfaceFn
= reinterpret_cast<eglCreatePbufferSurfaceProc
>(
43 GetGLProcAddress("eglCreatePbufferSurface"));
44 fn
.eglCreatePixmapSurfaceFn
= reinterpret_cast<eglCreatePixmapSurfaceProc
>(
45 GetGLProcAddress("eglCreatePixmapSurface"));
46 fn
.eglCreateSyncKHRFn
= 0;
47 fn
.eglCreateWindowSurfaceFn
= reinterpret_cast<eglCreateWindowSurfaceProc
>(
48 GetGLProcAddress("eglCreateWindowSurface"));
49 fn
.eglDestroyContextFn
= reinterpret_cast<eglDestroyContextProc
>(
50 GetGLProcAddress("eglDestroyContext"));
51 fn
.eglDestroyImageKHRFn
= 0;
52 fn
.eglDestroySurfaceFn
= reinterpret_cast<eglDestroySurfaceProc
>(
53 GetGLProcAddress("eglDestroySurface"));
54 fn
.eglDestroySyncKHRFn
= 0;
55 fn
.eglGetConfigAttribFn
= reinterpret_cast<eglGetConfigAttribProc
>(
56 GetGLProcAddress("eglGetConfigAttrib"));
58 reinterpret_cast<eglGetConfigsProc
>(GetGLProcAddress("eglGetConfigs"));
59 fn
.eglGetCurrentContextFn
= reinterpret_cast<eglGetCurrentContextProc
>(
60 GetGLProcAddress("eglGetCurrentContext"));
61 fn
.eglGetCurrentDisplayFn
= reinterpret_cast<eglGetCurrentDisplayProc
>(
62 GetGLProcAddress("eglGetCurrentDisplay"));
63 fn
.eglGetCurrentSurfaceFn
= reinterpret_cast<eglGetCurrentSurfaceProc
>(
64 GetGLProcAddress("eglGetCurrentSurface"));
66 reinterpret_cast<eglGetDisplayProc
>(GetGLProcAddress("eglGetDisplay"));
68 reinterpret_cast<eglGetErrorProc
>(GetGLProcAddress("eglGetError"));
69 fn
.eglGetPlatformDisplayEXTFn
= 0;
70 fn
.eglGetProcAddressFn
= reinterpret_cast<eglGetProcAddressProc
>(
71 GetGLProcAddress("eglGetProcAddress"));
72 fn
.eglGetSyncAttribKHRFn
= 0;
73 fn
.eglGetSyncValuesCHROMIUMFn
= 0;
75 reinterpret_cast<eglInitializeProc
>(GetGLProcAddress("eglInitialize"));
77 reinterpret_cast<eglMakeCurrentProc
>(GetGLProcAddress("eglMakeCurrent"));
78 fn
.eglPostSubBufferNVFn
= 0;
80 reinterpret_cast<eglQueryAPIProc
>(GetGLProcAddress("eglQueryAPI"));
81 fn
.eglQueryContextFn
= reinterpret_cast<eglQueryContextProc
>(
82 GetGLProcAddress("eglQueryContext"));
84 reinterpret_cast<eglQueryStringProc
>(GetGLProcAddress("eglQueryString"));
85 fn
.eglQuerySurfaceFn
= reinterpret_cast<eglQuerySurfaceProc
>(
86 GetGLProcAddress("eglQuerySurface"));
87 fn
.eglQuerySurfacePointerANGLEFn
= 0;
88 fn
.eglReleaseTexImageFn
= reinterpret_cast<eglReleaseTexImageProc
>(
89 GetGLProcAddress("eglReleaseTexImage"));
90 fn
.eglReleaseThreadFn
= reinterpret_cast<eglReleaseThreadProc
>(
91 GetGLProcAddress("eglReleaseThread"));
92 fn
.eglSurfaceAttribFn
= reinterpret_cast<eglSurfaceAttribProc
>(
93 GetGLProcAddress("eglSurfaceAttrib"));
95 reinterpret_cast<eglSwapBuffersProc
>(GetGLProcAddress("eglSwapBuffers"));
96 fn
.eglSwapIntervalFn
= reinterpret_cast<eglSwapIntervalProc
>(
97 GetGLProcAddress("eglSwapInterval"));
99 reinterpret_cast<eglTerminateProc
>(GetGLProcAddress("eglTerminate"));
101 reinterpret_cast<eglWaitClientProc
>(GetGLProcAddress("eglWaitClient"));
103 reinterpret_cast<eglWaitGLProc
>(GetGLProcAddress("eglWaitGL"));
105 reinterpret_cast<eglWaitNativeProc
>(GetGLProcAddress("eglWaitNative"));
106 fn
.eglWaitSyncKHRFn
= 0;
107 std::string
client_extensions(GetClientExtensions());
108 client_extensions
+= " ";
109 ALLOW_UNUSED_LOCAL(client_extensions
);
111 ext
.b_EGL_EXT_platform_base
=
112 client_extensions
.find("EGL_EXT_platform_base ") != std::string::npos
;
114 debug_fn
.eglGetPlatformDisplayEXTFn
= 0;
115 if (ext
.b_EGL_EXT_platform_base
) {
116 fn
.eglGetPlatformDisplayEXTFn
=
117 reinterpret_cast<eglGetPlatformDisplayEXTProc
>(
118 GetGLProcAddress("eglGetPlatformDisplayEXT"));
119 DCHECK(fn
.eglGetPlatformDisplayEXTFn
);
121 std::string
extensions(GetPlatformExtensions());
123 ALLOW_UNUSED_LOCAL(extensions
);
125 ext
.b_EGL_ANGLE_d3d_share_handle_client_buffer
=
126 extensions
.find("EGL_ANGLE_d3d_share_handle_client_buffer ") !=
128 ext
.b_EGL_ANGLE_query_surface_pointer
=
129 extensions
.find("EGL_ANGLE_query_surface_pointer ") != std::string::npos
;
130 ext
.b_EGL_ANGLE_surface_d3d_texture_2d_share_handle
=
131 extensions
.find("EGL_ANGLE_surface_d3d_texture_2d_share_handle ") !=
133 ext
.b_EGL_CHROMIUM_sync_control
=
134 extensions
.find("EGL_CHROMIUM_sync_control ") != std::string::npos
;
135 ext
.b_EGL_KHR_fence_sync
=
136 extensions
.find("EGL_KHR_fence_sync ") != std::string::npos
;
137 ext
.b_EGL_KHR_gl_texture_2D_image
=
138 extensions
.find("EGL_KHR_gl_texture_2D_image ") != std::string::npos
;
139 ext
.b_EGL_KHR_image
= extensions
.find("EGL_KHR_image ") != std::string::npos
;
140 ext
.b_EGL_KHR_image_base
=
141 extensions
.find("EGL_KHR_image_base ") != std::string::npos
;
142 ext
.b_EGL_KHR_reusable_sync
=
143 extensions
.find("EGL_KHR_reusable_sync ") != std::string::npos
;
144 ext
.b_EGL_KHR_wait_sync
=
145 extensions
.find("EGL_KHR_wait_sync ") != std::string::npos
;
146 ext
.b_EGL_NV_post_sub_buffer
=
147 extensions
.find("EGL_NV_post_sub_buffer ") != std::string::npos
;
149 debug_fn
.eglClientWaitSyncKHRFn
= 0;
150 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
151 fn
.eglClientWaitSyncKHRFn
= reinterpret_cast<eglClientWaitSyncKHRProc
>(
152 GetGLProcAddress("eglClientWaitSyncKHR"));
153 DCHECK(fn
.eglClientWaitSyncKHRFn
);
156 debug_fn
.eglCreateImageKHRFn
= 0;
157 if (ext
.b_EGL_KHR_image
|| ext
.b_EGL_KHR_image_base
||
158 ext
.b_EGL_KHR_gl_texture_2D_image
) {
159 fn
.eglCreateImageKHRFn
= reinterpret_cast<eglCreateImageKHRProc
>(
160 GetGLProcAddress("eglCreateImageKHR"));
161 DCHECK(fn
.eglCreateImageKHRFn
);
164 debug_fn
.eglCreateSyncKHRFn
= 0;
165 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
166 fn
.eglCreateSyncKHRFn
= reinterpret_cast<eglCreateSyncKHRProc
>(
167 GetGLProcAddress("eglCreateSyncKHR"));
168 DCHECK(fn
.eglCreateSyncKHRFn
);
171 debug_fn
.eglDestroyImageKHRFn
= 0;
172 if (ext
.b_EGL_KHR_image
|| ext
.b_EGL_KHR_image_base
) {
173 fn
.eglDestroyImageKHRFn
= reinterpret_cast<eglDestroyImageKHRProc
>(
174 GetGLProcAddress("eglDestroyImageKHR"));
175 DCHECK(fn
.eglDestroyImageKHRFn
);
178 debug_fn
.eglDestroySyncKHRFn
= 0;
179 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
180 fn
.eglDestroySyncKHRFn
= reinterpret_cast<eglDestroySyncKHRProc
>(
181 GetGLProcAddress("eglDestroySyncKHR"));
182 DCHECK(fn
.eglDestroySyncKHRFn
);
185 debug_fn
.eglGetSyncAttribKHRFn
= 0;
186 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
187 fn
.eglGetSyncAttribKHRFn
= reinterpret_cast<eglGetSyncAttribKHRProc
>(
188 GetGLProcAddress("eglGetSyncAttribKHR"));
189 DCHECK(fn
.eglGetSyncAttribKHRFn
);
192 debug_fn
.eglGetSyncValuesCHROMIUMFn
= 0;
193 if (ext
.b_EGL_CHROMIUM_sync_control
) {
194 fn
.eglGetSyncValuesCHROMIUMFn
=
195 reinterpret_cast<eglGetSyncValuesCHROMIUMProc
>(
196 GetGLProcAddress("eglGetSyncValuesCHROMIUM"));
197 DCHECK(fn
.eglGetSyncValuesCHROMIUMFn
);
200 debug_fn
.eglPostSubBufferNVFn
= 0;
201 if (ext
.b_EGL_NV_post_sub_buffer
) {
202 fn
.eglPostSubBufferNVFn
= reinterpret_cast<eglPostSubBufferNVProc
>(
203 GetGLProcAddress("eglPostSubBufferNV"));
204 DCHECK(fn
.eglPostSubBufferNVFn
);
207 debug_fn
.eglQuerySurfacePointerANGLEFn
= 0;
208 if (ext
.b_EGL_ANGLE_query_surface_pointer
) {
209 fn
.eglQuerySurfacePointerANGLEFn
=
210 reinterpret_cast<eglQuerySurfacePointerANGLEProc
>(
211 GetGLProcAddress("eglQuerySurfacePointerANGLE"));
212 DCHECK(fn
.eglQuerySurfacePointerANGLEFn
);
215 debug_fn
.eglWaitSyncKHRFn
= 0;
216 if (ext
.b_EGL_KHR_wait_sync
) {
217 fn
.eglWaitSyncKHRFn
= reinterpret_cast<eglWaitSyncKHRProc
>(
218 GetGLProcAddress("eglWaitSyncKHR"));
219 DCHECK(fn
.eglWaitSyncKHRFn
);
222 if (g_debugBindingsInitialized
)
223 InitializeDebugBindings();
228 static EGLBoolean GL_BINDING_CALL
Debug_eglBindAPI(EGLenum api
) {
229 GL_SERVICE_LOG("eglBindAPI"
230 << "(" << api
<< ")");
231 EGLBoolean result
= g_driver_egl
.debug_fn
.eglBindAPIFn(api
);
232 GL_SERVICE_LOG("GL_RESULT: " << result
);
236 static EGLBoolean GL_BINDING_CALL
237 Debug_eglBindTexImage(EGLDisplay dpy
, EGLSurface surface
, EGLint buffer
) {
238 GL_SERVICE_LOG("eglBindTexImage"
239 << "(" << dpy
<< ", " << surface
<< ", " << buffer
<< ")");
241 g_driver_egl
.debug_fn
.eglBindTexImageFn(dpy
, surface
, buffer
);
242 GL_SERVICE_LOG("GL_RESULT: " << result
);
246 static EGLBoolean GL_BINDING_CALL
247 Debug_eglChooseConfig(EGLDisplay dpy
,
248 const EGLint
* attrib_list
,
251 EGLint
* num_config
) {
252 GL_SERVICE_LOG("eglChooseConfig"
253 << "(" << dpy
<< ", " << static_cast<const void*>(attrib_list
)
254 << ", " << static_cast<const void*>(configs
) << ", "
255 << config_size
<< ", " << static_cast<const void*>(num_config
)
257 EGLBoolean result
= g_driver_egl
.debug_fn
.eglChooseConfigFn(
258 dpy
, attrib_list
, configs
, config_size
, num_config
);
259 GL_SERVICE_LOG("GL_RESULT: " << result
);
263 static EGLint GL_BINDING_CALL
Debug_eglClientWaitSyncKHR(EGLDisplay dpy
,
266 EGLTimeKHR timeout
) {
267 GL_SERVICE_LOG("eglClientWaitSyncKHR"
268 << "(" << dpy
<< ", " << sync
<< ", " << flags
<< ", "
271 g_driver_egl
.debug_fn
.eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
272 GL_SERVICE_LOG("GL_RESULT: " << result
);
276 static EGLBoolean GL_BINDING_CALL
277 Debug_eglCopyBuffers(EGLDisplay dpy
,
279 EGLNativePixmapType target
) {
280 GL_SERVICE_LOG("eglCopyBuffers"
281 << "(" << dpy
<< ", " << surface
<< ", " << target
<< ")");
283 g_driver_egl
.debug_fn
.eglCopyBuffersFn(dpy
, surface
, target
);
284 GL_SERVICE_LOG("GL_RESULT: " << result
);
288 static EGLContext GL_BINDING_CALL
289 Debug_eglCreateContext(EGLDisplay dpy
,
291 EGLContext share_context
,
292 const EGLint
* attrib_list
) {
293 GL_SERVICE_LOG("eglCreateContext"
294 << "(" << dpy
<< ", " << config
<< ", " << share_context
295 << ", " << static_cast<const void*>(attrib_list
) << ")");
296 EGLContext result
= g_driver_egl
.debug_fn
.eglCreateContextFn(
297 dpy
, config
, share_context
, attrib_list
);
298 GL_SERVICE_LOG("GL_RESULT: " << result
);
302 static EGLImageKHR GL_BINDING_CALL
303 Debug_eglCreateImageKHR(EGLDisplay dpy
,
306 EGLClientBuffer buffer
,
307 const EGLint
* attrib_list
) {
308 GL_SERVICE_LOG("eglCreateImageKHR"
309 << "(" << dpy
<< ", " << ctx
<< ", " << target
<< ", "
310 << buffer
<< ", " << static_cast<const void*>(attrib_list
)
312 EGLImageKHR result
= g_driver_egl
.debug_fn
.eglCreateImageKHRFn(
313 dpy
, ctx
, target
, buffer
, attrib_list
);
314 GL_SERVICE_LOG("GL_RESULT: " << result
);
318 static EGLSurface GL_BINDING_CALL
319 Debug_eglCreatePbufferFromClientBuffer(EGLDisplay dpy
,
323 const EGLint
* attrib_list
) {
324 GL_SERVICE_LOG("eglCreatePbufferFromClientBuffer"
325 << "(" << dpy
<< ", " << buftype
<< ", "
326 << static_cast<const void*>(buffer
) << ", " << config
<< ", "
327 << static_cast<const void*>(attrib_list
) << ")");
328 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreatePbufferFromClientBufferFn(
329 dpy
, buftype
, buffer
, config
, attrib_list
);
330 GL_SERVICE_LOG("GL_RESULT: " << result
);
334 static EGLSurface GL_BINDING_CALL
335 Debug_eglCreatePbufferSurface(EGLDisplay dpy
,
337 const EGLint
* attrib_list
) {
338 GL_SERVICE_LOG("eglCreatePbufferSurface"
339 << "(" << dpy
<< ", " << config
<< ", "
340 << static_cast<const void*>(attrib_list
) << ")");
342 g_driver_egl
.debug_fn
.eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
343 GL_SERVICE_LOG("GL_RESULT: " << result
);
347 static EGLSurface GL_BINDING_CALL
348 Debug_eglCreatePixmapSurface(EGLDisplay dpy
,
350 EGLNativePixmapType pixmap
,
351 const EGLint
* attrib_list
) {
352 GL_SERVICE_LOG("eglCreatePixmapSurface"
353 << "(" << dpy
<< ", " << config
<< ", " << pixmap
<< ", "
354 << static_cast<const void*>(attrib_list
) << ")");
355 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreatePixmapSurfaceFn(
356 dpy
, config
, pixmap
, attrib_list
);
357 GL_SERVICE_LOG("GL_RESULT: " << result
);
361 static EGLSyncKHR GL_BINDING_CALL
362 Debug_eglCreateSyncKHR(EGLDisplay dpy
,
364 const EGLint
* attrib_list
) {
365 GL_SERVICE_LOG("eglCreateSyncKHR"
366 << "(" << dpy
<< ", " << type
<< ", "
367 << static_cast<const void*>(attrib_list
) << ")");
369 g_driver_egl
.debug_fn
.eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
370 GL_SERVICE_LOG("GL_RESULT: " << result
);
374 static EGLSurface GL_BINDING_CALL
375 Debug_eglCreateWindowSurface(EGLDisplay dpy
,
377 EGLNativeWindowType win
,
378 const EGLint
* attrib_list
) {
379 GL_SERVICE_LOG("eglCreateWindowSurface"
380 << "(" << dpy
<< ", " << config
<< ", " << win
<< ", "
381 << static_cast<const void*>(attrib_list
) << ")");
382 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreateWindowSurfaceFn(
383 dpy
, config
, win
, attrib_list
);
384 GL_SERVICE_LOG("GL_RESULT: " << result
);
388 static EGLBoolean GL_BINDING_CALL
389 Debug_eglDestroyContext(EGLDisplay dpy
, EGLContext ctx
) {
390 GL_SERVICE_LOG("eglDestroyContext"
391 << "(" << dpy
<< ", " << ctx
<< ")");
392 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroyContextFn(dpy
, ctx
);
393 GL_SERVICE_LOG("GL_RESULT: " << result
);
397 static EGLBoolean GL_BINDING_CALL
398 Debug_eglDestroyImageKHR(EGLDisplay dpy
, EGLImageKHR image
) {
399 GL_SERVICE_LOG("eglDestroyImageKHR"
400 << "(" << dpy
<< ", " << image
<< ")");
401 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroyImageKHRFn(dpy
, image
);
402 GL_SERVICE_LOG("GL_RESULT: " << result
);
406 static EGLBoolean GL_BINDING_CALL
407 Debug_eglDestroySurface(EGLDisplay dpy
, EGLSurface surface
) {
408 GL_SERVICE_LOG("eglDestroySurface"
409 << "(" << dpy
<< ", " << surface
<< ")");
410 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroySurfaceFn(dpy
, surface
);
411 GL_SERVICE_LOG("GL_RESULT: " << result
);
415 static EGLBoolean GL_BINDING_CALL
416 Debug_eglDestroySyncKHR(EGLDisplay dpy
, EGLSyncKHR sync
) {
417 GL_SERVICE_LOG("eglDestroySyncKHR"
418 << "(" << dpy
<< ", " << sync
<< ")");
419 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroySyncKHRFn(dpy
, sync
);
420 GL_SERVICE_LOG("GL_RESULT: " << result
);
424 static EGLBoolean GL_BINDING_CALL
Debug_eglGetConfigAttrib(EGLDisplay dpy
,
428 GL_SERVICE_LOG("eglGetConfigAttrib"
429 << "(" << dpy
<< ", " << config
<< ", " << attribute
<< ", "
430 << static_cast<const void*>(value
) << ")");
432 g_driver_egl
.debug_fn
.eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
433 GL_SERVICE_LOG("GL_RESULT: " << result
);
437 static EGLBoolean GL_BINDING_CALL
Debug_eglGetConfigs(EGLDisplay dpy
,
440 EGLint
* num_config
) {
441 GL_SERVICE_LOG("eglGetConfigs"
442 << "(" << dpy
<< ", " << static_cast<const void*>(configs
)
443 << ", " << config_size
<< ", "
444 << static_cast<const void*>(num_config
) << ")");
445 EGLBoolean result
= g_driver_egl
.debug_fn
.eglGetConfigsFn(
446 dpy
, configs
, config_size
, num_config
);
447 GL_SERVICE_LOG("GL_RESULT: " << result
);
451 static EGLContext GL_BINDING_CALL
Debug_eglGetCurrentContext(void) {
452 GL_SERVICE_LOG("eglGetCurrentContext"
455 EGLContext result
= g_driver_egl
.debug_fn
.eglGetCurrentContextFn();
456 GL_SERVICE_LOG("GL_RESULT: " << result
);
460 static EGLDisplay GL_BINDING_CALL
Debug_eglGetCurrentDisplay(void) {
461 GL_SERVICE_LOG("eglGetCurrentDisplay"
464 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetCurrentDisplayFn();
465 GL_SERVICE_LOG("GL_RESULT: " << result
);
469 static EGLSurface GL_BINDING_CALL
Debug_eglGetCurrentSurface(EGLint readdraw
) {
470 GL_SERVICE_LOG("eglGetCurrentSurface"
471 << "(" << readdraw
<< ")");
472 EGLSurface result
= g_driver_egl
.debug_fn
.eglGetCurrentSurfaceFn(readdraw
);
473 GL_SERVICE_LOG("GL_RESULT: " << result
);
477 static EGLDisplay GL_BINDING_CALL
478 Debug_eglGetDisplay(EGLNativeDisplayType display_id
) {
479 GL_SERVICE_LOG("eglGetDisplay"
480 << "(" << display_id
<< ")");
481 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetDisplayFn(display_id
);
482 GL_SERVICE_LOG("GL_RESULT: " << result
);
486 static EGLint GL_BINDING_CALL
Debug_eglGetError(void) {
487 GL_SERVICE_LOG("eglGetError"
490 EGLint result
= g_driver_egl
.debug_fn
.eglGetErrorFn();
491 GL_SERVICE_LOG("GL_RESULT: " << result
);
495 static EGLDisplay GL_BINDING_CALL
496 Debug_eglGetPlatformDisplayEXT(EGLenum platform
,
497 void* native_display
,
498 const EGLint
* attrib_list
) {
499 GL_SERVICE_LOG("eglGetPlatformDisplayEXT"
500 << "(" << platform
<< ", "
501 << static_cast<const void*>(native_display
) << ", "
502 << static_cast<const void*>(attrib_list
) << ")");
503 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetPlatformDisplayEXTFn(
504 platform
, native_display
, attrib_list
);
505 GL_SERVICE_LOG("GL_RESULT: " << result
);
509 static __eglMustCastToProperFunctionPointerType GL_BINDING_CALL
510 Debug_eglGetProcAddress(const char* procname
) {
511 GL_SERVICE_LOG("eglGetProcAddress"
512 << "(" << procname
<< ")");
513 __eglMustCastToProperFunctionPointerType result
=
514 g_driver_egl
.debug_fn
.eglGetProcAddressFn(procname
);
515 GL_SERVICE_LOG("GL_RESULT: " << result
);
519 static EGLBoolean GL_BINDING_CALL
Debug_eglGetSyncAttribKHR(EGLDisplay dpy
,
523 GL_SERVICE_LOG("eglGetSyncAttribKHR"
524 << "(" << dpy
<< ", " << sync
<< ", " << attribute
<< ", "
525 << static_cast<const void*>(value
) << ")");
527 g_driver_egl
.debug_fn
.eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
528 GL_SERVICE_LOG("GL_RESULT: " << result
);
532 static EGLBoolean GL_BINDING_CALL
533 Debug_eglGetSyncValuesCHROMIUM(EGLDisplay dpy
,
535 EGLuint64CHROMIUM
* ust
,
536 EGLuint64CHROMIUM
* msc
,
537 EGLuint64CHROMIUM
* sbc
) {
538 GL_SERVICE_LOG("eglGetSyncValuesCHROMIUM"
539 << "(" << dpy
<< ", " << surface
<< ", "
540 << static_cast<const void*>(ust
) << ", "
541 << static_cast<const void*>(msc
) << ", "
542 << static_cast<const void*>(sbc
) << ")");
543 EGLBoolean result
= g_driver_egl
.debug_fn
.eglGetSyncValuesCHROMIUMFn(
544 dpy
, surface
, ust
, msc
, sbc
);
545 GL_SERVICE_LOG("GL_RESULT: " << result
);
549 static EGLBoolean GL_BINDING_CALL
550 Debug_eglInitialize(EGLDisplay dpy
, EGLint
* major
, EGLint
* minor
) {
551 GL_SERVICE_LOG("eglInitialize"
552 << "(" << dpy
<< ", " << static_cast<const void*>(major
)
553 << ", " << static_cast<const void*>(minor
) << ")");
554 EGLBoolean result
= g_driver_egl
.debug_fn
.eglInitializeFn(dpy
, major
, minor
);
555 GL_SERVICE_LOG("GL_RESULT: " << result
);
559 static EGLBoolean GL_BINDING_CALL
Debug_eglMakeCurrent(EGLDisplay dpy
,
563 GL_SERVICE_LOG("eglMakeCurrent"
564 << "(" << dpy
<< ", " << draw
<< ", " << read
<< ", " << ctx
567 g_driver_egl
.debug_fn
.eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
568 GL_SERVICE_LOG("GL_RESULT: " << result
);
572 static EGLBoolean GL_BINDING_CALL
Debug_eglPostSubBufferNV(EGLDisplay dpy
,
578 GL_SERVICE_LOG("eglPostSubBufferNV"
579 << "(" << dpy
<< ", " << surface
<< ", " << x
<< ", " << y
580 << ", " << width
<< ", " << height
<< ")");
581 EGLBoolean result
= g_driver_egl
.debug_fn
.eglPostSubBufferNVFn(
582 dpy
, surface
, x
, y
, width
, height
);
583 GL_SERVICE_LOG("GL_RESULT: " << result
);
587 static EGLenum GL_BINDING_CALL
Debug_eglQueryAPI(void) {
588 GL_SERVICE_LOG("eglQueryAPI"
591 EGLenum result
= g_driver_egl
.debug_fn
.eglQueryAPIFn();
592 GL_SERVICE_LOG("GL_RESULT: " << result
);
596 static EGLBoolean GL_BINDING_CALL
Debug_eglQueryContext(EGLDisplay dpy
,
600 GL_SERVICE_LOG("eglQueryContext"
601 << "(" << dpy
<< ", " << ctx
<< ", " << attribute
<< ", "
602 << static_cast<const void*>(value
) << ")");
604 g_driver_egl
.debug_fn
.eglQueryContextFn(dpy
, ctx
, attribute
, value
);
605 GL_SERVICE_LOG("GL_RESULT: " << result
);
609 static const char* GL_BINDING_CALL
610 Debug_eglQueryString(EGLDisplay dpy
, EGLint name
) {
611 GL_SERVICE_LOG("eglQueryString"
612 << "(" << dpy
<< ", " << name
<< ")");
613 const char* result
= g_driver_egl
.debug_fn
.eglQueryStringFn(dpy
, name
);
614 GL_SERVICE_LOG("GL_RESULT: " << result
);
618 static EGLBoolean GL_BINDING_CALL
Debug_eglQuerySurface(EGLDisplay dpy
,
622 GL_SERVICE_LOG("eglQuerySurface"
623 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
624 << static_cast<const void*>(value
) << ")");
626 g_driver_egl
.debug_fn
.eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
627 GL_SERVICE_LOG("GL_RESULT: " << result
);
631 static EGLBoolean GL_BINDING_CALL
632 Debug_eglQuerySurfacePointerANGLE(EGLDisplay dpy
,
636 GL_SERVICE_LOG("eglQuerySurfacePointerANGLE"
637 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
639 EGLBoolean result
= g_driver_egl
.debug_fn
.eglQuerySurfacePointerANGLEFn(
640 dpy
, surface
, attribute
, value
);
641 GL_SERVICE_LOG("GL_RESULT: " << result
);
645 static EGLBoolean GL_BINDING_CALL
646 Debug_eglReleaseTexImage(EGLDisplay dpy
, EGLSurface surface
, EGLint buffer
) {
647 GL_SERVICE_LOG("eglReleaseTexImage"
648 << "(" << dpy
<< ", " << surface
<< ", " << buffer
<< ")");
650 g_driver_egl
.debug_fn
.eglReleaseTexImageFn(dpy
, surface
, buffer
);
651 GL_SERVICE_LOG("GL_RESULT: " << result
);
655 static EGLBoolean GL_BINDING_CALL
Debug_eglReleaseThread(void) {
656 GL_SERVICE_LOG("eglReleaseThread"
659 EGLBoolean result
= g_driver_egl
.debug_fn
.eglReleaseThreadFn();
660 GL_SERVICE_LOG("GL_RESULT: " << result
);
664 static EGLBoolean GL_BINDING_CALL
Debug_eglSurfaceAttrib(EGLDisplay dpy
,
668 GL_SERVICE_LOG("eglSurfaceAttrib"
669 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
672 g_driver_egl
.debug_fn
.eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
673 GL_SERVICE_LOG("GL_RESULT: " << result
);
677 static EGLBoolean GL_BINDING_CALL
678 Debug_eglSwapBuffers(EGLDisplay dpy
, EGLSurface surface
) {
679 GL_SERVICE_LOG("eglSwapBuffers"
680 << "(" << dpy
<< ", " << surface
<< ")");
681 EGLBoolean result
= g_driver_egl
.debug_fn
.eglSwapBuffersFn(dpy
, surface
);
682 GL_SERVICE_LOG("GL_RESULT: " << result
);
686 static EGLBoolean GL_BINDING_CALL
687 Debug_eglSwapInterval(EGLDisplay dpy
, EGLint interval
) {
688 GL_SERVICE_LOG("eglSwapInterval"
689 << "(" << dpy
<< ", " << interval
<< ")");
690 EGLBoolean result
= g_driver_egl
.debug_fn
.eglSwapIntervalFn(dpy
, interval
);
691 GL_SERVICE_LOG("GL_RESULT: " << result
);
695 static EGLBoolean GL_BINDING_CALL
Debug_eglTerminate(EGLDisplay dpy
) {
696 GL_SERVICE_LOG("eglTerminate"
697 << "(" << dpy
<< ")");
698 EGLBoolean result
= g_driver_egl
.debug_fn
.eglTerminateFn(dpy
);
699 GL_SERVICE_LOG("GL_RESULT: " << result
);
703 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitClient(void) {
704 GL_SERVICE_LOG("eglWaitClient"
707 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitClientFn();
708 GL_SERVICE_LOG("GL_RESULT: " << result
);
712 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitGL(void) {
713 GL_SERVICE_LOG("eglWaitGL"
716 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitGLFn();
717 GL_SERVICE_LOG("GL_RESULT: " << result
);
721 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitNative(EGLint engine
) {
722 GL_SERVICE_LOG("eglWaitNative"
723 << "(" << engine
<< ")");
724 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitNativeFn(engine
);
725 GL_SERVICE_LOG("GL_RESULT: " << result
);
729 static EGLint GL_BINDING_CALL
730 Debug_eglWaitSyncKHR(EGLDisplay dpy
, EGLSyncKHR sync
, EGLint flags
) {
731 GL_SERVICE_LOG("eglWaitSyncKHR"
732 << "(" << dpy
<< ", " << sync
<< ", " << flags
<< ")");
733 EGLint result
= g_driver_egl
.debug_fn
.eglWaitSyncKHRFn(dpy
, sync
, flags
);
734 GL_SERVICE_LOG("GL_RESULT: " << result
);
739 void DriverEGL::InitializeDebugBindings() {
740 if (!debug_fn
.eglBindAPIFn
) {
741 debug_fn
.eglBindAPIFn
= fn
.eglBindAPIFn
;
742 fn
.eglBindAPIFn
= Debug_eglBindAPI
;
744 if (!debug_fn
.eglBindTexImageFn
) {
745 debug_fn
.eglBindTexImageFn
= fn
.eglBindTexImageFn
;
746 fn
.eglBindTexImageFn
= Debug_eglBindTexImage
;
748 if (!debug_fn
.eglChooseConfigFn
) {
749 debug_fn
.eglChooseConfigFn
= fn
.eglChooseConfigFn
;
750 fn
.eglChooseConfigFn
= Debug_eglChooseConfig
;
752 if (!debug_fn
.eglClientWaitSyncKHRFn
) {
753 debug_fn
.eglClientWaitSyncKHRFn
= fn
.eglClientWaitSyncKHRFn
;
754 fn
.eglClientWaitSyncKHRFn
= Debug_eglClientWaitSyncKHR
;
756 if (!debug_fn
.eglCopyBuffersFn
) {
757 debug_fn
.eglCopyBuffersFn
= fn
.eglCopyBuffersFn
;
758 fn
.eglCopyBuffersFn
= Debug_eglCopyBuffers
;
760 if (!debug_fn
.eglCreateContextFn
) {
761 debug_fn
.eglCreateContextFn
= fn
.eglCreateContextFn
;
762 fn
.eglCreateContextFn
= Debug_eglCreateContext
;
764 if (!debug_fn
.eglCreateImageKHRFn
) {
765 debug_fn
.eglCreateImageKHRFn
= fn
.eglCreateImageKHRFn
;
766 fn
.eglCreateImageKHRFn
= Debug_eglCreateImageKHR
;
768 if (!debug_fn
.eglCreatePbufferFromClientBufferFn
) {
769 debug_fn
.eglCreatePbufferFromClientBufferFn
=
770 fn
.eglCreatePbufferFromClientBufferFn
;
771 fn
.eglCreatePbufferFromClientBufferFn
=
772 Debug_eglCreatePbufferFromClientBuffer
;
774 if (!debug_fn
.eglCreatePbufferSurfaceFn
) {
775 debug_fn
.eglCreatePbufferSurfaceFn
= fn
.eglCreatePbufferSurfaceFn
;
776 fn
.eglCreatePbufferSurfaceFn
= Debug_eglCreatePbufferSurface
;
778 if (!debug_fn
.eglCreatePixmapSurfaceFn
) {
779 debug_fn
.eglCreatePixmapSurfaceFn
= fn
.eglCreatePixmapSurfaceFn
;
780 fn
.eglCreatePixmapSurfaceFn
= Debug_eglCreatePixmapSurface
;
782 if (!debug_fn
.eglCreateSyncKHRFn
) {
783 debug_fn
.eglCreateSyncKHRFn
= fn
.eglCreateSyncKHRFn
;
784 fn
.eglCreateSyncKHRFn
= Debug_eglCreateSyncKHR
;
786 if (!debug_fn
.eglCreateWindowSurfaceFn
) {
787 debug_fn
.eglCreateWindowSurfaceFn
= fn
.eglCreateWindowSurfaceFn
;
788 fn
.eglCreateWindowSurfaceFn
= Debug_eglCreateWindowSurface
;
790 if (!debug_fn
.eglDestroyContextFn
) {
791 debug_fn
.eglDestroyContextFn
= fn
.eglDestroyContextFn
;
792 fn
.eglDestroyContextFn
= Debug_eglDestroyContext
;
794 if (!debug_fn
.eglDestroyImageKHRFn
) {
795 debug_fn
.eglDestroyImageKHRFn
= fn
.eglDestroyImageKHRFn
;
796 fn
.eglDestroyImageKHRFn
= Debug_eglDestroyImageKHR
;
798 if (!debug_fn
.eglDestroySurfaceFn
) {
799 debug_fn
.eglDestroySurfaceFn
= fn
.eglDestroySurfaceFn
;
800 fn
.eglDestroySurfaceFn
= Debug_eglDestroySurface
;
802 if (!debug_fn
.eglDestroySyncKHRFn
) {
803 debug_fn
.eglDestroySyncKHRFn
= fn
.eglDestroySyncKHRFn
;
804 fn
.eglDestroySyncKHRFn
= Debug_eglDestroySyncKHR
;
806 if (!debug_fn
.eglGetConfigAttribFn
) {
807 debug_fn
.eglGetConfigAttribFn
= fn
.eglGetConfigAttribFn
;
808 fn
.eglGetConfigAttribFn
= Debug_eglGetConfigAttrib
;
810 if (!debug_fn
.eglGetConfigsFn
) {
811 debug_fn
.eglGetConfigsFn
= fn
.eglGetConfigsFn
;
812 fn
.eglGetConfigsFn
= Debug_eglGetConfigs
;
814 if (!debug_fn
.eglGetCurrentContextFn
) {
815 debug_fn
.eglGetCurrentContextFn
= fn
.eglGetCurrentContextFn
;
816 fn
.eglGetCurrentContextFn
= Debug_eglGetCurrentContext
;
818 if (!debug_fn
.eglGetCurrentDisplayFn
) {
819 debug_fn
.eglGetCurrentDisplayFn
= fn
.eglGetCurrentDisplayFn
;
820 fn
.eglGetCurrentDisplayFn
= Debug_eglGetCurrentDisplay
;
822 if (!debug_fn
.eglGetCurrentSurfaceFn
) {
823 debug_fn
.eglGetCurrentSurfaceFn
= fn
.eglGetCurrentSurfaceFn
;
824 fn
.eglGetCurrentSurfaceFn
= Debug_eglGetCurrentSurface
;
826 if (!debug_fn
.eglGetDisplayFn
) {
827 debug_fn
.eglGetDisplayFn
= fn
.eglGetDisplayFn
;
828 fn
.eglGetDisplayFn
= Debug_eglGetDisplay
;
830 if (!debug_fn
.eglGetErrorFn
) {
831 debug_fn
.eglGetErrorFn
= fn
.eglGetErrorFn
;
832 fn
.eglGetErrorFn
= Debug_eglGetError
;
834 if (!debug_fn
.eglGetPlatformDisplayEXTFn
) {
835 debug_fn
.eglGetPlatformDisplayEXTFn
= fn
.eglGetPlatformDisplayEXTFn
;
836 fn
.eglGetPlatformDisplayEXTFn
= Debug_eglGetPlatformDisplayEXT
;
838 if (!debug_fn
.eglGetProcAddressFn
) {
839 debug_fn
.eglGetProcAddressFn
= fn
.eglGetProcAddressFn
;
840 fn
.eglGetProcAddressFn
= Debug_eglGetProcAddress
;
842 if (!debug_fn
.eglGetSyncAttribKHRFn
) {
843 debug_fn
.eglGetSyncAttribKHRFn
= fn
.eglGetSyncAttribKHRFn
;
844 fn
.eglGetSyncAttribKHRFn
= Debug_eglGetSyncAttribKHR
;
846 if (!debug_fn
.eglGetSyncValuesCHROMIUMFn
) {
847 debug_fn
.eglGetSyncValuesCHROMIUMFn
= fn
.eglGetSyncValuesCHROMIUMFn
;
848 fn
.eglGetSyncValuesCHROMIUMFn
= Debug_eglGetSyncValuesCHROMIUM
;
850 if (!debug_fn
.eglInitializeFn
) {
851 debug_fn
.eglInitializeFn
= fn
.eglInitializeFn
;
852 fn
.eglInitializeFn
= Debug_eglInitialize
;
854 if (!debug_fn
.eglMakeCurrentFn
) {
855 debug_fn
.eglMakeCurrentFn
= fn
.eglMakeCurrentFn
;
856 fn
.eglMakeCurrentFn
= Debug_eglMakeCurrent
;
858 if (!debug_fn
.eglPostSubBufferNVFn
) {
859 debug_fn
.eglPostSubBufferNVFn
= fn
.eglPostSubBufferNVFn
;
860 fn
.eglPostSubBufferNVFn
= Debug_eglPostSubBufferNV
;
862 if (!debug_fn
.eglQueryAPIFn
) {
863 debug_fn
.eglQueryAPIFn
= fn
.eglQueryAPIFn
;
864 fn
.eglQueryAPIFn
= Debug_eglQueryAPI
;
866 if (!debug_fn
.eglQueryContextFn
) {
867 debug_fn
.eglQueryContextFn
= fn
.eglQueryContextFn
;
868 fn
.eglQueryContextFn
= Debug_eglQueryContext
;
870 if (!debug_fn
.eglQueryStringFn
) {
871 debug_fn
.eglQueryStringFn
= fn
.eglQueryStringFn
;
872 fn
.eglQueryStringFn
= Debug_eglQueryString
;
874 if (!debug_fn
.eglQuerySurfaceFn
) {
875 debug_fn
.eglQuerySurfaceFn
= fn
.eglQuerySurfaceFn
;
876 fn
.eglQuerySurfaceFn
= Debug_eglQuerySurface
;
878 if (!debug_fn
.eglQuerySurfacePointerANGLEFn
) {
879 debug_fn
.eglQuerySurfacePointerANGLEFn
= fn
.eglQuerySurfacePointerANGLEFn
;
880 fn
.eglQuerySurfacePointerANGLEFn
= Debug_eglQuerySurfacePointerANGLE
;
882 if (!debug_fn
.eglReleaseTexImageFn
) {
883 debug_fn
.eglReleaseTexImageFn
= fn
.eglReleaseTexImageFn
;
884 fn
.eglReleaseTexImageFn
= Debug_eglReleaseTexImage
;
886 if (!debug_fn
.eglReleaseThreadFn
) {
887 debug_fn
.eglReleaseThreadFn
= fn
.eglReleaseThreadFn
;
888 fn
.eglReleaseThreadFn
= Debug_eglReleaseThread
;
890 if (!debug_fn
.eglSurfaceAttribFn
) {
891 debug_fn
.eglSurfaceAttribFn
= fn
.eglSurfaceAttribFn
;
892 fn
.eglSurfaceAttribFn
= Debug_eglSurfaceAttrib
;
894 if (!debug_fn
.eglSwapBuffersFn
) {
895 debug_fn
.eglSwapBuffersFn
= fn
.eglSwapBuffersFn
;
896 fn
.eglSwapBuffersFn
= Debug_eglSwapBuffers
;
898 if (!debug_fn
.eglSwapIntervalFn
) {
899 debug_fn
.eglSwapIntervalFn
= fn
.eglSwapIntervalFn
;
900 fn
.eglSwapIntervalFn
= Debug_eglSwapInterval
;
902 if (!debug_fn
.eglTerminateFn
) {
903 debug_fn
.eglTerminateFn
= fn
.eglTerminateFn
;
904 fn
.eglTerminateFn
= Debug_eglTerminate
;
906 if (!debug_fn
.eglWaitClientFn
) {
907 debug_fn
.eglWaitClientFn
= fn
.eglWaitClientFn
;
908 fn
.eglWaitClientFn
= Debug_eglWaitClient
;
910 if (!debug_fn
.eglWaitGLFn
) {
911 debug_fn
.eglWaitGLFn
= fn
.eglWaitGLFn
;
912 fn
.eglWaitGLFn
= Debug_eglWaitGL
;
914 if (!debug_fn
.eglWaitNativeFn
) {
915 debug_fn
.eglWaitNativeFn
= fn
.eglWaitNativeFn
;
916 fn
.eglWaitNativeFn
= Debug_eglWaitNative
;
918 if (!debug_fn
.eglWaitSyncKHRFn
) {
919 debug_fn
.eglWaitSyncKHRFn
= fn
.eglWaitSyncKHRFn
;
920 fn
.eglWaitSyncKHRFn
= Debug_eglWaitSyncKHR
;
922 g_debugBindingsInitialized
= true;
925 void DriverEGL::ClearBindings() {
926 memset(this, 0, sizeof(*this));
929 EGLBoolean
EGLApiBase::eglBindAPIFn(EGLenum api
) {
930 return driver_
->fn
.eglBindAPIFn(api
);
933 EGLBoolean
EGLApiBase::eglBindTexImageFn(EGLDisplay dpy
,
936 return driver_
->fn
.eglBindTexImageFn(dpy
, surface
, buffer
);
939 EGLBoolean
EGLApiBase::eglChooseConfigFn(EGLDisplay dpy
,
940 const EGLint
* attrib_list
,
943 EGLint
* num_config
) {
944 return driver_
->fn
.eglChooseConfigFn(dpy
, attrib_list
, configs
, config_size
,
948 EGLint
EGLApiBase::eglClientWaitSyncKHRFn(EGLDisplay dpy
,
951 EGLTimeKHR timeout
) {
952 return driver_
->fn
.eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
955 EGLBoolean
EGLApiBase::eglCopyBuffersFn(EGLDisplay dpy
,
957 EGLNativePixmapType target
) {
958 return driver_
->fn
.eglCopyBuffersFn(dpy
, surface
, target
);
961 EGLContext
EGLApiBase::eglCreateContextFn(EGLDisplay dpy
,
963 EGLContext share_context
,
964 const EGLint
* attrib_list
) {
965 return driver_
->fn
.eglCreateContextFn(dpy
, config
, share_context
,
969 EGLImageKHR
EGLApiBase::eglCreateImageKHRFn(EGLDisplay dpy
,
972 EGLClientBuffer buffer
,
973 const EGLint
* attrib_list
) {
974 return driver_
->fn
.eglCreateImageKHRFn(dpy
, ctx
, target
, buffer
, attrib_list
);
977 EGLSurface
EGLApiBase::eglCreatePbufferFromClientBufferFn(
982 const EGLint
* attrib_list
) {
983 return driver_
->fn
.eglCreatePbufferFromClientBufferFn(dpy
, buftype
, buffer
,
984 config
, attrib_list
);
987 EGLSurface
EGLApiBase::eglCreatePbufferSurfaceFn(EGLDisplay dpy
,
989 const EGLint
* attrib_list
) {
990 return driver_
->fn
.eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
993 EGLSurface
EGLApiBase::eglCreatePixmapSurfaceFn(EGLDisplay dpy
,
995 EGLNativePixmapType pixmap
,
996 const EGLint
* attrib_list
) {
997 return driver_
->fn
.eglCreatePixmapSurfaceFn(dpy
, config
, pixmap
, attrib_list
);
1000 EGLSyncKHR
EGLApiBase::eglCreateSyncKHRFn(EGLDisplay dpy
,
1002 const EGLint
* attrib_list
) {
1003 return driver_
->fn
.eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
1006 EGLSurface
EGLApiBase::eglCreateWindowSurfaceFn(EGLDisplay dpy
,
1008 EGLNativeWindowType win
,
1009 const EGLint
* attrib_list
) {
1010 return driver_
->fn
.eglCreateWindowSurfaceFn(dpy
, config
, win
, attrib_list
);
1013 EGLBoolean
EGLApiBase::eglDestroyContextFn(EGLDisplay dpy
, EGLContext ctx
) {
1014 return driver_
->fn
.eglDestroyContextFn(dpy
, ctx
);
1017 EGLBoolean
EGLApiBase::eglDestroyImageKHRFn(EGLDisplay dpy
, EGLImageKHR image
) {
1018 return driver_
->fn
.eglDestroyImageKHRFn(dpy
, image
);
1021 EGLBoolean
EGLApiBase::eglDestroySurfaceFn(EGLDisplay dpy
, EGLSurface surface
) {
1022 return driver_
->fn
.eglDestroySurfaceFn(dpy
, surface
);
1025 EGLBoolean
EGLApiBase::eglDestroySyncKHRFn(EGLDisplay dpy
, EGLSyncKHR sync
) {
1026 return driver_
->fn
.eglDestroySyncKHRFn(dpy
, sync
);
1029 EGLBoolean
EGLApiBase::eglGetConfigAttribFn(EGLDisplay dpy
,
1033 return driver_
->fn
.eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
1036 EGLBoolean
EGLApiBase::eglGetConfigsFn(EGLDisplay dpy
,
1039 EGLint
* num_config
) {
1040 return driver_
->fn
.eglGetConfigsFn(dpy
, configs
, config_size
, num_config
);
1043 EGLContext
EGLApiBase::eglGetCurrentContextFn(void) {
1044 return driver_
->fn
.eglGetCurrentContextFn();
1047 EGLDisplay
EGLApiBase::eglGetCurrentDisplayFn(void) {
1048 return driver_
->fn
.eglGetCurrentDisplayFn();
1051 EGLSurface
EGLApiBase::eglGetCurrentSurfaceFn(EGLint readdraw
) {
1052 return driver_
->fn
.eglGetCurrentSurfaceFn(readdraw
);
1055 EGLDisplay
EGLApiBase::eglGetDisplayFn(EGLNativeDisplayType display_id
) {
1056 return driver_
->fn
.eglGetDisplayFn(display_id
);
1059 EGLint
EGLApiBase::eglGetErrorFn(void) {
1060 return driver_
->fn
.eglGetErrorFn();
1063 EGLDisplay
EGLApiBase::eglGetPlatformDisplayEXTFn(EGLenum platform
,
1064 void* native_display
,
1065 const EGLint
* attrib_list
) {
1066 return driver_
->fn
.eglGetPlatformDisplayEXTFn(platform
, native_display
,
1070 __eglMustCastToProperFunctionPointerType
EGLApiBase::eglGetProcAddressFn(
1071 const char* procname
) {
1072 return driver_
->fn
.eglGetProcAddressFn(procname
);
1075 EGLBoolean
EGLApiBase::eglGetSyncAttribKHRFn(EGLDisplay dpy
,
1079 return driver_
->fn
.eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
1082 EGLBoolean
EGLApiBase::eglGetSyncValuesCHROMIUMFn(EGLDisplay dpy
,
1084 EGLuint64CHROMIUM
* ust
,
1085 EGLuint64CHROMIUM
* msc
,
1086 EGLuint64CHROMIUM
* sbc
) {
1087 return driver_
->fn
.eglGetSyncValuesCHROMIUMFn(dpy
, surface
, ust
, msc
, sbc
);
1090 EGLBoolean
EGLApiBase::eglInitializeFn(EGLDisplay dpy
,
1093 return driver_
->fn
.eglInitializeFn(dpy
, major
, minor
);
1096 EGLBoolean
EGLApiBase::eglMakeCurrentFn(EGLDisplay dpy
,
1100 return driver_
->fn
.eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
1103 EGLBoolean
EGLApiBase::eglPostSubBufferNVFn(EGLDisplay dpy
,
1109 return driver_
->fn
.eglPostSubBufferNVFn(dpy
, surface
, x
, y
, width
, height
);
1112 EGLenum
EGLApiBase::eglQueryAPIFn(void) {
1113 return driver_
->fn
.eglQueryAPIFn();
1116 EGLBoolean
EGLApiBase::eglQueryContextFn(EGLDisplay dpy
,
1120 return driver_
->fn
.eglQueryContextFn(dpy
, ctx
, attribute
, value
);
1123 const char* EGLApiBase::eglQueryStringFn(EGLDisplay dpy
, EGLint name
) {
1124 return driver_
->fn
.eglQueryStringFn(dpy
, name
);
1127 EGLBoolean
EGLApiBase::eglQuerySurfaceFn(EGLDisplay dpy
,
1131 return driver_
->fn
.eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
1134 EGLBoolean
EGLApiBase::eglQuerySurfacePointerANGLEFn(EGLDisplay dpy
,
1138 return driver_
->fn
.eglQuerySurfacePointerANGLEFn(dpy
, surface
, attribute
,
1142 EGLBoolean
EGLApiBase::eglReleaseTexImageFn(EGLDisplay dpy
,
1145 return driver_
->fn
.eglReleaseTexImageFn(dpy
, surface
, buffer
);
1148 EGLBoolean
EGLApiBase::eglReleaseThreadFn(void) {
1149 return driver_
->fn
.eglReleaseThreadFn();
1152 EGLBoolean
EGLApiBase::eglSurfaceAttribFn(EGLDisplay dpy
,
1156 return driver_
->fn
.eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
1159 EGLBoolean
EGLApiBase::eglSwapBuffersFn(EGLDisplay dpy
, EGLSurface surface
) {
1160 return driver_
->fn
.eglSwapBuffersFn(dpy
, surface
);
1163 EGLBoolean
EGLApiBase::eglSwapIntervalFn(EGLDisplay dpy
, EGLint interval
) {
1164 return driver_
->fn
.eglSwapIntervalFn(dpy
, interval
);
1167 EGLBoolean
EGLApiBase::eglTerminateFn(EGLDisplay dpy
) {
1168 return driver_
->fn
.eglTerminateFn(dpy
);
1171 EGLBoolean
EGLApiBase::eglWaitClientFn(void) {
1172 return driver_
->fn
.eglWaitClientFn();
1175 EGLBoolean
EGLApiBase::eglWaitGLFn(void) {
1176 return driver_
->fn
.eglWaitGLFn();
1179 EGLBoolean
EGLApiBase::eglWaitNativeFn(EGLint engine
) {
1180 return driver_
->fn
.eglWaitNativeFn(engine
);
1183 EGLint
EGLApiBase::eglWaitSyncKHRFn(EGLDisplay dpy
,
1186 return driver_
->fn
.eglWaitSyncKHRFn(dpy
, sync
, flags
);
1189 EGLBoolean
TraceEGLApi::eglBindAPIFn(EGLenum api
) {
1190 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglBindAPI")
1191 return egl_api_
->eglBindAPIFn(api
);
1194 EGLBoolean
TraceEGLApi::eglBindTexImageFn(EGLDisplay dpy
,
1197 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglBindTexImage")
1198 return egl_api_
->eglBindTexImageFn(dpy
, surface
, buffer
);
1201 EGLBoolean
TraceEGLApi::eglChooseConfigFn(EGLDisplay dpy
,
1202 const EGLint
* attrib_list
,
1205 EGLint
* num_config
) {
1206 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglChooseConfig")
1207 return egl_api_
->eglChooseConfigFn(dpy
, attrib_list
, configs
, config_size
,
1211 EGLint
TraceEGLApi::eglClientWaitSyncKHRFn(EGLDisplay dpy
,
1214 EGLTimeKHR timeout
) {
1215 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglClientWaitSyncKHR")
1216 return egl_api_
->eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
1219 EGLBoolean
TraceEGLApi::eglCopyBuffersFn(EGLDisplay dpy
,
1221 EGLNativePixmapType target
) {
1222 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCopyBuffers")
1223 return egl_api_
->eglCopyBuffersFn(dpy
, surface
, target
);
1226 EGLContext
TraceEGLApi::eglCreateContextFn(EGLDisplay dpy
,
1228 EGLContext share_context
,
1229 const EGLint
* attrib_list
) {
1230 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateContext")
1231 return egl_api_
->eglCreateContextFn(dpy
, config
, share_context
, attrib_list
);
1234 EGLImageKHR
TraceEGLApi::eglCreateImageKHRFn(EGLDisplay dpy
,
1237 EGLClientBuffer buffer
,
1238 const EGLint
* attrib_list
) {
1239 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateImageKHR")
1240 return egl_api_
->eglCreateImageKHRFn(dpy
, ctx
, target
, buffer
, attrib_list
);
1243 EGLSurface
TraceEGLApi::eglCreatePbufferFromClientBufferFn(
1248 const EGLint
* attrib_list
) {
1249 TRACE_EVENT_BINARY_EFFICIENT0("gpu",
1250 "TraceGLAPI::eglCreatePbufferFromClientBuffer")
1251 return egl_api_
->eglCreatePbufferFromClientBufferFn(dpy
, buftype
, buffer
,
1252 config
, attrib_list
);
1255 EGLSurface
TraceEGLApi::eglCreatePbufferSurfaceFn(EGLDisplay dpy
,
1257 const EGLint
* attrib_list
) {
1258 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreatePbufferSurface")
1259 return egl_api_
->eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
1262 EGLSurface
TraceEGLApi::eglCreatePixmapSurfaceFn(EGLDisplay dpy
,
1264 EGLNativePixmapType pixmap
,
1265 const EGLint
* attrib_list
) {
1266 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreatePixmapSurface")
1267 return egl_api_
->eglCreatePixmapSurfaceFn(dpy
, config
, pixmap
, attrib_list
);
1270 EGLSyncKHR
TraceEGLApi::eglCreateSyncKHRFn(EGLDisplay dpy
,
1272 const EGLint
* attrib_list
) {
1273 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateSyncKHR")
1274 return egl_api_
->eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
1277 EGLSurface
TraceEGLApi::eglCreateWindowSurfaceFn(EGLDisplay dpy
,
1279 EGLNativeWindowType win
,
1280 const EGLint
* attrib_list
) {
1281 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateWindowSurface")
1282 return egl_api_
->eglCreateWindowSurfaceFn(dpy
, config
, win
, attrib_list
);
1285 EGLBoolean
TraceEGLApi::eglDestroyContextFn(EGLDisplay dpy
, EGLContext ctx
) {
1286 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroyContext")
1287 return egl_api_
->eglDestroyContextFn(dpy
, ctx
);
1290 EGLBoolean
TraceEGLApi::eglDestroyImageKHRFn(EGLDisplay dpy
,
1291 EGLImageKHR image
) {
1292 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroyImageKHR")
1293 return egl_api_
->eglDestroyImageKHRFn(dpy
, image
);
1296 EGLBoolean
TraceEGLApi::eglDestroySurfaceFn(EGLDisplay dpy
,
1297 EGLSurface surface
) {
1298 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroySurface")
1299 return egl_api_
->eglDestroySurfaceFn(dpy
, surface
);
1302 EGLBoolean
TraceEGLApi::eglDestroySyncKHRFn(EGLDisplay dpy
, EGLSyncKHR sync
) {
1303 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroySyncKHR")
1304 return egl_api_
->eglDestroySyncKHRFn(dpy
, sync
);
1307 EGLBoolean
TraceEGLApi::eglGetConfigAttribFn(EGLDisplay dpy
,
1311 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetConfigAttrib")
1312 return egl_api_
->eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
1315 EGLBoolean
TraceEGLApi::eglGetConfigsFn(EGLDisplay dpy
,
1318 EGLint
* num_config
) {
1319 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetConfigs")
1320 return egl_api_
->eglGetConfigsFn(dpy
, configs
, config_size
, num_config
);
1323 EGLContext
TraceEGLApi::eglGetCurrentContextFn(void) {
1324 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentContext")
1325 return egl_api_
->eglGetCurrentContextFn();
1328 EGLDisplay
TraceEGLApi::eglGetCurrentDisplayFn(void) {
1329 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentDisplay")
1330 return egl_api_
->eglGetCurrentDisplayFn();
1333 EGLSurface
TraceEGLApi::eglGetCurrentSurfaceFn(EGLint readdraw
) {
1334 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentSurface")
1335 return egl_api_
->eglGetCurrentSurfaceFn(readdraw
);
1338 EGLDisplay
TraceEGLApi::eglGetDisplayFn(EGLNativeDisplayType display_id
) {
1339 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetDisplay")
1340 return egl_api_
->eglGetDisplayFn(display_id
);
1343 EGLint
TraceEGLApi::eglGetErrorFn(void) {
1344 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetError")
1345 return egl_api_
->eglGetErrorFn();
1348 EGLDisplay
TraceEGLApi::eglGetPlatformDisplayEXTFn(EGLenum platform
,
1349 void* native_display
,
1350 const EGLint
* attrib_list
) {
1351 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetPlatformDisplayEXT")
1352 return egl_api_
->eglGetPlatformDisplayEXTFn(platform
, native_display
,
1356 __eglMustCastToProperFunctionPointerType
TraceEGLApi::eglGetProcAddressFn(
1357 const char* procname
) {
1358 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetProcAddress")
1359 return egl_api_
->eglGetProcAddressFn(procname
);
1362 EGLBoolean
TraceEGLApi::eglGetSyncAttribKHRFn(EGLDisplay dpy
,
1366 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetSyncAttribKHR")
1367 return egl_api_
->eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
1370 EGLBoolean
TraceEGLApi::eglGetSyncValuesCHROMIUMFn(EGLDisplay dpy
,
1372 EGLuint64CHROMIUM
* ust
,
1373 EGLuint64CHROMIUM
* msc
,
1374 EGLuint64CHROMIUM
* sbc
) {
1375 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetSyncValuesCHROMIUM")
1376 return egl_api_
->eglGetSyncValuesCHROMIUMFn(dpy
, surface
, ust
, msc
, sbc
);
1379 EGLBoolean
TraceEGLApi::eglInitializeFn(EGLDisplay dpy
,
1382 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglInitialize")
1383 return egl_api_
->eglInitializeFn(dpy
, major
, minor
);
1386 EGLBoolean
TraceEGLApi::eglMakeCurrentFn(EGLDisplay dpy
,
1390 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglMakeCurrent")
1391 return egl_api_
->eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
1394 EGLBoolean
TraceEGLApi::eglPostSubBufferNVFn(EGLDisplay dpy
,
1400 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglPostSubBufferNV")
1401 return egl_api_
->eglPostSubBufferNVFn(dpy
, surface
, x
, y
, width
, height
);
1404 EGLenum
TraceEGLApi::eglQueryAPIFn(void) {
1405 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryAPI")
1406 return egl_api_
->eglQueryAPIFn();
1409 EGLBoolean
TraceEGLApi::eglQueryContextFn(EGLDisplay dpy
,
1413 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryContext")
1414 return egl_api_
->eglQueryContextFn(dpy
, ctx
, attribute
, value
);
1417 const char* TraceEGLApi::eglQueryStringFn(EGLDisplay dpy
, EGLint name
) {
1418 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryString")
1419 return egl_api_
->eglQueryStringFn(dpy
, name
);
1422 EGLBoolean
TraceEGLApi::eglQuerySurfaceFn(EGLDisplay dpy
,
1426 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQuerySurface")
1427 return egl_api_
->eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
1430 EGLBoolean
TraceEGLApi::eglQuerySurfacePointerANGLEFn(EGLDisplay dpy
,
1434 TRACE_EVENT_BINARY_EFFICIENT0("gpu",
1435 "TraceGLAPI::eglQuerySurfacePointerANGLE")
1436 return egl_api_
->eglQuerySurfacePointerANGLEFn(dpy
, surface
, attribute
,
1440 EGLBoolean
TraceEGLApi::eglReleaseTexImageFn(EGLDisplay dpy
,
1443 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglReleaseTexImage")
1444 return egl_api_
->eglReleaseTexImageFn(dpy
, surface
, buffer
);
1447 EGLBoolean
TraceEGLApi::eglReleaseThreadFn(void) {
1448 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglReleaseThread")
1449 return egl_api_
->eglReleaseThreadFn();
1452 EGLBoolean
TraceEGLApi::eglSurfaceAttribFn(EGLDisplay dpy
,
1456 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSurfaceAttrib")
1457 return egl_api_
->eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
1460 EGLBoolean
TraceEGLApi::eglSwapBuffersFn(EGLDisplay dpy
, EGLSurface surface
) {
1461 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSwapBuffers")
1462 return egl_api_
->eglSwapBuffersFn(dpy
, surface
);
1465 EGLBoolean
TraceEGLApi::eglSwapIntervalFn(EGLDisplay dpy
, EGLint interval
) {
1466 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSwapInterval")
1467 return egl_api_
->eglSwapIntervalFn(dpy
, interval
);
1470 EGLBoolean
TraceEGLApi::eglTerminateFn(EGLDisplay dpy
) {
1471 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglTerminate")
1472 return egl_api_
->eglTerminateFn(dpy
);
1475 EGLBoolean
TraceEGLApi::eglWaitClientFn(void) {
1476 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitClient")
1477 return egl_api_
->eglWaitClientFn();
1480 EGLBoolean
TraceEGLApi::eglWaitGLFn(void) {
1481 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitGL")
1482 return egl_api_
->eglWaitGLFn();
1485 EGLBoolean
TraceEGLApi::eglWaitNativeFn(EGLint engine
) {
1486 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitNative")
1487 return egl_api_
->eglWaitNativeFn(engine
);
1490 EGLint
TraceEGLApi::eglWaitSyncKHRFn(EGLDisplay dpy
,
1493 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitSyncKHR")
1494 return egl_api_
->eglWaitSyncKHRFn(dpy
, sync
, flags
);