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
extensions(GetPlatformExtensions());
109 ALLOW_UNUSED_LOCAL(extensions
);
111 ext
.b_EGL_ANGLE_d3d_share_handle_client_buffer
=
112 extensions
.find("EGL_ANGLE_d3d_share_handle_client_buffer ") !=
114 ext
.b_EGL_ANGLE_platform_angle
=
115 extensions
.find("EGL_ANGLE_platform_angle ") != std::string::npos
;
116 ext
.b_EGL_ANGLE_query_surface_pointer
=
117 extensions
.find("EGL_ANGLE_query_surface_pointer ") != std::string::npos
;
118 ext
.b_EGL_ANGLE_surface_d3d_texture_2d_share_handle
=
119 extensions
.find("EGL_ANGLE_surface_d3d_texture_2d_share_handle ") !=
121 ext
.b_EGL_CHROMIUM_sync_control
=
122 extensions
.find("EGL_CHROMIUM_sync_control ") != std::string::npos
;
123 ext
.b_EGL_KHR_fence_sync
=
124 extensions
.find("EGL_KHR_fence_sync ") != std::string::npos
;
125 ext
.b_EGL_KHR_gl_texture_2D_image
=
126 extensions
.find("EGL_KHR_gl_texture_2D_image ") != std::string::npos
;
127 ext
.b_EGL_KHR_image
= extensions
.find("EGL_KHR_image ") != std::string::npos
;
128 ext
.b_EGL_KHR_image_base
=
129 extensions
.find("EGL_KHR_image_base ") != std::string::npos
;
130 ext
.b_EGL_KHR_reusable_sync
=
131 extensions
.find("EGL_KHR_reusable_sync ") != std::string::npos
;
132 ext
.b_EGL_KHR_wait_sync
=
133 extensions
.find("EGL_KHR_wait_sync ") != std::string::npos
;
134 ext
.b_EGL_NV_post_sub_buffer
=
135 extensions
.find("EGL_NV_post_sub_buffer ") != std::string::npos
;
137 debug_fn
.eglClientWaitSyncKHRFn
= 0;
138 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
139 fn
.eglClientWaitSyncKHRFn
= reinterpret_cast<eglClientWaitSyncKHRProc
>(
140 GetGLProcAddress("eglClientWaitSyncKHR"));
141 DCHECK(fn
.eglClientWaitSyncKHRFn
);
144 debug_fn
.eglCreateImageKHRFn
= 0;
145 if (ext
.b_EGL_KHR_image
|| ext
.b_EGL_KHR_image_base
||
146 ext
.b_EGL_KHR_gl_texture_2D_image
) {
147 fn
.eglCreateImageKHRFn
= reinterpret_cast<eglCreateImageKHRProc
>(
148 GetGLProcAddress("eglCreateImageKHR"));
149 DCHECK(fn
.eglCreateImageKHRFn
);
152 debug_fn
.eglCreateSyncKHRFn
= 0;
153 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
154 fn
.eglCreateSyncKHRFn
= reinterpret_cast<eglCreateSyncKHRProc
>(
155 GetGLProcAddress("eglCreateSyncKHR"));
156 DCHECK(fn
.eglCreateSyncKHRFn
);
159 debug_fn
.eglDestroyImageKHRFn
= 0;
160 if (ext
.b_EGL_KHR_image
|| ext
.b_EGL_KHR_image_base
) {
161 fn
.eglDestroyImageKHRFn
= reinterpret_cast<eglDestroyImageKHRProc
>(
162 GetGLProcAddress("eglDestroyImageKHR"));
163 DCHECK(fn
.eglDestroyImageKHRFn
);
166 debug_fn
.eglDestroySyncKHRFn
= 0;
167 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
168 fn
.eglDestroySyncKHRFn
= reinterpret_cast<eglDestroySyncKHRProc
>(
169 GetGLProcAddress("eglDestroySyncKHR"));
170 DCHECK(fn
.eglDestroySyncKHRFn
);
173 debug_fn
.eglGetPlatformDisplayEXTFn
= 0;
174 if (ext
.b_EGL_ANGLE_platform_angle
) {
175 fn
.eglGetPlatformDisplayEXTFn
=
176 reinterpret_cast<eglGetPlatformDisplayEXTProc
>(
177 GetGLProcAddress("eglGetPlatformDisplayEXT"));
178 DCHECK(fn
.eglGetPlatformDisplayEXTFn
);
181 debug_fn
.eglGetSyncAttribKHRFn
= 0;
182 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_reusable_sync
) {
183 fn
.eglGetSyncAttribKHRFn
= reinterpret_cast<eglGetSyncAttribKHRProc
>(
184 GetGLProcAddress("eglGetSyncAttribKHR"));
185 DCHECK(fn
.eglGetSyncAttribKHRFn
);
188 debug_fn
.eglGetSyncValuesCHROMIUMFn
= 0;
189 if (ext
.b_EGL_CHROMIUM_sync_control
) {
190 fn
.eglGetSyncValuesCHROMIUMFn
=
191 reinterpret_cast<eglGetSyncValuesCHROMIUMProc
>(
192 GetGLProcAddress("eglGetSyncValuesCHROMIUM"));
193 DCHECK(fn
.eglGetSyncValuesCHROMIUMFn
);
196 debug_fn
.eglPostSubBufferNVFn
= 0;
197 if (ext
.b_EGL_NV_post_sub_buffer
) {
198 fn
.eglPostSubBufferNVFn
= reinterpret_cast<eglPostSubBufferNVProc
>(
199 GetGLProcAddress("eglPostSubBufferNV"));
200 DCHECK(fn
.eglPostSubBufferNVFn
);
203 debug_fn
.eglQuerySurfacePointerANGLEFn
= 0;
204 if (ext
.b_EGL_ANGLE_query_surface_pointer
) {
205 fn
.eglQuerySurfacePointerANGLEFn
=
206 reinterpret_cast<eglQuerySurfacePointerANGLEProc
>(
207 GetGLProcAddress("eglQuerySurfacePointerANGLE"));
208 DCHECK(fn
.eglQuerySurfacePointerANGLEFn
);
211 debug_fn
.eglWaitSyncKHRFn
= 0;
212 if (ext
.b_EGL_KHR_fence_sync
|| ext
.b_EGL_KHR_wait_sync
) {
213 fn
.eglWaitSyncKHRFn
= reinterpret_cast<eglWaitSyncKHRProc
>(
214 GetGLProcAddress("eglWaitSyncKHR"));
215 DCHECK(fn
.eglWaitSyncKHRFn
);
218 if (g_debugBindingsInitialized
)
219 InitializeDebugBindings();
224 static EGLBoolean GL_BINDING_CALL
Debug_eglBindAPI(EGLenum api
) {
225 GL_SERVICE_LOG("eglBindAPI"
226 << "(" << api
<< ")");
227 EGLBoolean result
= g_driver_egl
.debug_fn
.eglBindAPIFn(api
);
228 GL_SERVICE_LOG("GL_RESULT: " << result
);
232 static EGLBoolean GL_BINDING_CALL
233 Debug_eglBindTexImage(EGLDisplay dpy
, EGLSurface surface
, EGLint buffer
) {
234 GL_SERVICE_LOG("eglBindTexImage"
235 << "(" << dpy
<< ", " << surface
<< ", " << buffer
<< ")");
237 g_driver_egl
.debug_fn
.eglBindTexImageFn(dpy
, surface
, buffer
);
238 GL_SERVICE_LOG("GL_RESULT: " << result
);
242 static EGLBoolean GL_BINDING_CALL
243 Debug_eglChooseConfig(EGLDisplay dpy
,
244 const EGLint
* attrib_list
,
247 EGLint
* num_config
) {
248 GL_SERVICE_LOG("eglChooseConfig"
249 << "(" << dpy
<< ", " << static_cast<const void*>(attrib_list
)
250 << ", " << static_cast<const void*>(configs
) << ", "
251 << config_size
<< ", " << static_cast<const void*>(num_config
)
253 EGLBoolean result
= g_driver_egl
.debug_fn
.eglChooseConfigFn(
254 dpy
, attrib_list
, configs
, config_size
, num_config
);
255 GL_SERVICE_LOG("GL_RESULT: " << result
);
259 static EGLint GL_BINDING_CALL
Debug_eglClientWaitSyncKHR(EGLDisplay dpy
,
262 EGLTimeKHR timeout
) {
263 GL_SERVICE_LOG("eglClientWaitSyncKHR"
264 << "(" << dpy
<< ", " << sync
<< ", " << flags
<< ", "
267 g_driver_egl
.debug_fn
.eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
268 GL_SERVICE_LOG("GL_RESULT: " << result
);
272 static EGLBoolean GL_BINDING_CALL
273 Debug_eglCopyBuffers(EGLDisplay dpy
,
275 EGLNativePixmapType target
) {
276 GL_SERVICE_LOG("eglCopyBuffers"
277 << "(" << dpy
<< ", " << surface
<< ", " << target
<< ")");
279 g_driver_egl
.debug_fn
.eglCopyBuffersFn(dpy
, surface
, target
);
280 GL_SERVICE_LOG("GL_RESULT: " << result
);
284 static EGLContext GL_BINDING_CALL
285 Debug_eglCreateContext(EGLDisplay dpy
,
287 EGLContext share_context
,
288 const EGLint
* attrib_list
) {
289 GL_SERVICE_LOG("eglCreateContext"
290 << "(" << dpy
<< ", " << config
<< ", " << share_context
291 << ", " << static_cast<const void*>(attrib_list
) << ")");
292 EGLContext result
= g_driver_egl
.debug_fn
.eglCreateContextFn(
293 dpy
, config
, share_context
, attrib_list
);
294 GL_SERVICE_LOG("GL_RESULT: " << result
);
298 static EGLImageKHR GL_BINDING_CALL
299 Debug_eglCreateImageKHR(EGLDisplay dpy
,
302 EGLClientBuffer buffer
,
303 const EGLint
* attrib_list
) {
304 GL_SERVICE_LOG("eglCreateImageKHR"
305 << "(" << dpy
<< ", " << ctx
<< ", " << target
<< ", "
306 << buffer
<< ", " << static_cast<const void*>(attrib_list
)
308 EGLImageKHR result
= g_driver_egl
.debug_fn
.eglCreateImageKHRFn(
309 dpy
, ctx
, target
, buffer
, attrib_list
);
310 GL_SERVICE_LOG("GL_RESULT: " << result
);
314 static EGLSurface GL_BINDING_CALL
315 Debug_eglCreatePbufferFromClientBuffer(EGLDisplay dpy
,
319 const EGLint
* attrib_list
) {
320 GL_SERVICE_LOG("eglCreatePbufferFromClientBuffer"
321 << "(" << dpy
<< ", " << buftype
<< ", "
322 << static_cast<const void*>(buffer
) << ", " << config
<< ", "
323 << static_cast<const void*>(attrib_list
) << ")");
324 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreatePbufferFromClientBufferFn(
325 dpy
, buftype
, buffer
, config
, attrib_list
);
326 GL_SERVICE_LOG("GL_RESULT: " << result
);
330 static EGLSurface GL_BINDING_CALL
331 Debug_eglCreatePbufferSurface(EGLDisplay dpy
,
333 const EGLint
* attrib_list
) {
334 GL_SERVICE_LOG("eglCreatePbufferSurface"
335 << "(" << dpy
<< ", " << config
<< ", "
336 << static_cast<const void*>(attrib_list
) << ")");
338 g_driver_egl
.debug_fn
.eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
339 GL_SERVICE_LOG("GL_RESULT: " << result
);
343 static EGLSurface GL_BINDING_CALL
344 Debug_eglCreatePixmapSurface(EGLDisplay dpy
,
346 EGLNativePixmapType pixmap
,
347 const EGLint
* attrib_list
) {
348 GL_SERVICE_LOG("eglCreatePixmapSurface"
349 << "(" << dpy
<< ", " << config
<< ", " << pixmap
<< ", "
350 << static_cast<const void*>(attrib_list
) << ")");
351 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreatePixmapSurfaceFn(
352 dpy
, config
, pixmap
, attrib_list
);
353 GL_SERVICE_LOG("GL_RESULT: " << result
);
357 static EGLSyncKHR GL_BINDING_CALL
358 Debug_eglCreateSyncKHR(EGLDisplay dpy
,
360 const EGLint
* attrib_list
) {
361 GL_SERVICE_LOG("eglCreateSyncKHR"
362 << "(" << dpy
<< ", " << type
<< ", "
363 << static_cast<const void*>(attrib_list
) << ")");
365 g_driver_egl
.debug_fn
.eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
366 GL_SERVICE_LOG("GL_RESULT: " << result
);
370 static EGLSurface GL_BINDING_CALL
371 Debug_eglCreateWindowSurface(EGLDisplay dpy
,
373 EGLNativeWindowType win
,
374 const EGLint
* attrib_list
) {
375 GL_SERVICE_LOG("eglCreateWindowSurface"
376 << "(" << dpy
<< ", " << config
<< ", " << win
<< ", "
377 << static_cast<const void*>(attrib_list
) << ")");
378 EGLSurface result
= g_driver_egl
.debug_fn
.eglCreateWindowSurfaceFn(
379 dpy
, config
, win
, attrib_list
);
380 GL_SERVICE_LOG("GL_RESULT: " << result
);
384 static EGLBoolean GL_BINDING_CALL
385 Debug_eglDestroyContext(EGLDisplay dpy
, EGLContext ctx
) {
386 GL_SERVICE_LOG("eglDestroyContext"
387 << "(" << dpy
<< ", " << ctx
<< ")");
388 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroyContextFn(dpy
, ctx
);
389 GL_SERVICE_LOG("GL_RESULT: " << result
);
393 static EGLBoolean GL_BINDING_CALL
394 Debug_eglDestroyImageKHR(EGLDisplay dpy
, EGLImageKHR image
) {
395 GL_SERVICE_LOG("eglDestroyImageKHR"
396 << "(" << dpy
<< ", " << image
<< ")");
397 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroyImageKHRFn(dpy
, image
);
398 GL_SERVICE_LOG("GL_RESULT: " << result
);
402 static EGLBoolean GL_BINDING_CALL
403 Debug_eglDestroySurface(EGLDisplay dpy
, EGLSurface surface
) {
404 GL_SERVICE_LOG("eglDestroySurface"
405 << "(" << dpy
<< ", " << surface
<< ")");
406 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroySurfaceFn(dpy
, surface
);
407 GL_SERVICE_LOG("GL_RESULT: " << result
);
411 static EGLBoolean GL_BINDING_CALL
412 Debug_eglDestroySyncKHR(EGLDisplay dpy
, EGLSyncKHR sync
) {
413 GL_SERVICE_LOG("eglDestroySyncKHR"
414 << "(" << dpy
<< ", " << sync
<< ")");
415 EGLBoolean result
= g_driver_egl
.debug_fn
.eglDestroySyncKHRFn(dpy
, sync
);
416 GL_SERVICE_LOG("GL_RESULT: " << result
);
420 static EGLBoolean GL_BINDING_CALL
Debug_eglGetConfigAttrib(EGLDisplay dpy
,
424 GL_SERVICE_LOG("eglGetConfigAttrib"
425 << "(" << dpy
<< ", " << config
<< ", " << attribute
<< ", "
426 << static_cast<const void*>(value
) << ")");
428 g_driver_egl
.debug_fn
.eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
429 GL_SERVICE_LOG("GL_RESULT: " << result
);
433 static EGLBoolean GL_BINDING_CALL
Debug_eglGetConfigs(EGLDisplay dpy
,
436 EGLint
* num_config
) {
437 GL_SERVICE_LOG("eglGetConfigs"
438 << "(" << dpy
<< ", " << static_cast<const void*>(configs
)
439 << ", " << config_size
<< ", "
440 << static_cast<const void*>(num_config
) << ")");
441 EGLBoolean result
= g_driver_egl
.debug_fn
.eglGetConfigsFn(
442 dpy
, configs
, config_size
, num_config
);
443 GL_SERVICE_LOG("GL_RESULT: " << result
);
447 static EGLContext GL_BINDING_CALL
Debug_eglGetCurrentContext(void) {
448 GL_SERVICE_LOG("eglGetCurrentContext"
451 EGLContext result
= g_driver_egl
.debug_fn
.eglGetCurrentContextFn();
452 GL_SERVICE_LOG("GL_RESULT: " << result
);
456 static EGLDisplay GL_BINDING_CALL
Debug_eglGetCurrentDisplay(void) {
457 GL_SERVICE_LOG("eglGetCurrentDisplay"
460 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetCurrentDisplayFn();
461 GL_SERVICE_LOG("GL_RESULT: " << result
);
465 static EGLSurface GL_BINDING_CALL
Debug_eglGetCurrentSurface(EGLint readdraw
) {
466 GL_SERVICE_LOG("eglGetCurrentSurface"
467 << "(" << readdraw
<< ")");
468 EGLSurface result
= g_driver_egl
.debug_fn
.eglGetCurrentSurfaceFn(readdraw
);
469 GL_SERVICE_LOG("GL_RESULT: " << result
);
473 static EGLDisplay GL_BINDING_CALL
474 Debug_eglGetDisplay(EGLNativeDisplayType display_id
) {
475 GL_SERVICE_LOG("eglGetDisplay"
476 << "(" << display_id
<< ")");
477 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetDisplayFn(display_id
);
478 GL_SERVICE_LOG("GL_RESULT: " << result
);
482 static EGLint GL_BINDING_CALL
Debug_eglGetError(void) {
483 GL_SERVICE_LOG("eglGetError"
486 EGLint result
= g_driver_egl
.debug_fn
.eglGetErrorFn();
487 GL_SERVICE_LOG("GL_RESULT: " << result
);
491 static EGLDisplay GL_BINDING_CALL
492 Debug_eglGetPlatformDisplayEXT(EGLenum platform
,
493 void* native_display
,
494 const EGLint
* attrib_list
) {
495 GL_SERVICE_LOG("eglGetPlatformDisplayEXT"
496 << "(" << platform
<< ", "
497 << static_cast<const void*>(native_display
) << ", "
498 << static_cast<const void*>(attrib_list
) << ")");
499 EGLDisplay result
= g_driver_egl
.debug_fn
.eglGetPlatformDisplayEXTFn(
500 platform
, native_display
, attrib_list
);
501 GL_SERVICE_LOG("GL_RESULT: " << result
);
505 static __eglMustCastToProperFunctionPointerType GL_BINDING_CALL
506 Debug_eglGetProcAddress(const char* procname
) {
507 GL_SERVICE_LOG("eglGetProcAddress"
508 << "(" << procname
<< ")");
509 __eglMustCastToProperFunctionPointerType result
=
510 g_driver_egl
.debug_fn
.eglGetProcAddressFn(procname
);
511 GL_SERVICE_LOG("GL_RESULT: " << result
);
515 static EGLBoolean GL_BINDING_CALL
Debug_eglGetSyncAttribKHR(EGLDisplay dpy
,
519 GL_SERVICE_LOG("eglGetSyncAttribKHR"
520 << "(" << dpy
<< ", " << sync
<< ", " << attribute
<< ", "
521 << static_cast<const void*>(value
) << ")");
523 g_driver_egl
.debug_fn
.eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
524 GL_SERVICE_LOG("GL_RESULT: " << result
);
528 static EGLBoolean GL_BINDING_CALL
529 Debug_eglGetSyncValuesCHROMIUM(EGLDisplay dpy
,
531 EGLuint64CHROMIUM
* ust
,
532 EGLuint64CHROMIUM
* msc
,
533 EGLuint64CHROMIUM
* sbc
) {
534 GL_SERVICE_LOG("eglGetSyncValuesCHROMIUM"
535 << "(" << dpy
<< ", " << surface
<< ", "
536 << static_cast<const void*>(ust
) << ", "
537 << static_cast<const void*>(msc
) << ", "
538 << static_cast<const void*>(sbc
) << ")");
539 EGLBoolean result
= g_driver_egl
.debug_fn
.eglGetSyncValuesCHROMIUMFn(
540 dpy
, surface
, ust
, msc
, sbc
);
541 GL_SERVICE_LOG("GL_RESULT: " << result
);
545 static EGLBoolean GL_BINDING_CALL
546 Debug_eglInitialize(EGLDisplay dpy
, EGLint
* major
, EGLint
* minor
) {
547 GL_SERVICE_LOG("eglInitialize"
548 << "(" << dpy
<< ", " << static_cast<const void*>(major
)
549 << ", " << static_cast<const void*>(minor
) << ")");
550 EGLBoolean result
= g_driver_egl
.debug_fn
.eglInitializeFn(dpy
, major
, minor
);
551 GL_SERVICE_LOG("GL_RESULT: " << result
);
555 static EGLBoolean GL_BINDING_CALL
Debug_eglMakeCurrent(EGLDisplay dpy
,
559 GL_SERVICE_LOG("eglMakeCurrent"
560 << "(" << dpy
<< ", " << draw
<< ", " << read
<< ", " << ctx
563 g_driver_egl
.debug_fn
.eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
564 GL_SERVICE_LOG("GL_RESULT: " << result
);
568 static EGLBoolean GL_BINDING_CALL
Debug_eglPostSubBufferNV(EGLDisplay dpy
,
574 GL_SERVICE_LOG("eglPostSubBufferNV"
575 << "(" << dpy
<< ", " << surface
<< ", " << x
<< ", " << y
576 << ", " << width
<< ", " << height
<< ")");
577 EGLBoolean result
= g_driver_egl
.debug_fn
.eglPostSubBufferNVFn(
578 dpy
, surface
, x
, y
, width
, height
);
579 GL_SERVICE_LOG("GL_RESULT: " << result
);
583 static EGLenum GL_BINDING_CALL
Debug_eglQueryAPI(void) {
584 GL_SERVICE_LOG("eglQueryAPI"
587 EGLenum result
= g_driver_egl
.debug_fn
.eglQueryAPIFn();
588 GL_SERVICE_LOG("GL_RESULT: " << result
);
592 static EGLBoolean GL_BINDING_CALL
Debug_eglQueryContext(EGLDisplay dpy
,
596 GL_SERVICE_LOG("eglQueryContext"
597 << "(" << dpy
<< ", " << ctx
<< ", " << attribute
<< ", "
598 << static_cast<const void*>(value
) << ")");
600 g_driver_egl
.debug_fn
.eglQueryContextFn(dpy
, ctx
, attribute
, value
);
601 GL_SERVICE_LOG("GL_RESULT: " << result
);
605 static const char* GL_BINDING_CALL
606 Debug_eglQueryString(EGLDisplay dpy
, EGLint name
) {
607 GL_SERVICE_LOG("eglQueryString"
608 << "(" << dpy
<< ", " << name
<< ")");
609 const char* result
= g_driver_egl
.debug_fn
.eglQueryStringFn(dpy
, name
);
610 GL_SERVICE_LOG("GL_RESULT: " << result
);
614 static EGLBoolean GL_BINDING_CALL
Debug_eglQuerySurface(EGLDisplay dpy
,
618 GL_SERVICE_LOG("eglQuerySurface"
619 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
620 << static_cast<const void*>(value
) << ")");
622 g_driver_egl
.debug_fn
.eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
623 GL_SERVICE_LOG("GL_RESULT: " << result
);
627 static EGLBoolean GL_BINDING_CALL
628 Debug_eglQuerySurfacePointerANGLE(EGLDisplay dpy
,
632 GL_SERVICE_LOG("eglQuerySurfacePointerANGLE"
633 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
635 EGLBoolean result
= g_driver_egl
.debug_fn
.eglQuerySurfacePointerANGLEFn(
636 dpy
, surface
, attribute
, value
);
637 GL_SERVICE_LOG("GL_RESULT: " << result
);
641 static EGLBoolean GL_BINDING_CALL
642 Debug_eglReleaseTexImage(EGLDisplay dpy
, EGLSurface surface
, EGLint buffer
) {
643 GL_SERVICE_LOG("eglReleaseTexImage"
644 << "(" << dpy
<< ", " << surface
<< ", " << buffer
<< ")");
646 g_driver_egl
.debug_fn
.eglReleaseTexImageFn(dpy
, surface
, buffer
);
647 GL_SERVICE_LOG("GL_RESULT: " << result
);
651 static EGLBoolean GL_BINDING_CALL
Debug_eglReleaseThread(void) {
652 GL_SERVICE_LOG("eglReleaseThread"
655 EGLBoolean result
= g_driver_egl
.debug_fn
.eglReleaseThreadFn();
656 GL_SERVICE_LOG("GL_RESULT: " << result
);
660 static EGLBoolean GL_BINDING_CALL
Debug_eglSurfaceAttrib(EGLDisplay dpy
,
664 GL_SERVICE_LOG("eglSurfaceAttrib"
665 << "(" << dpy
<< ", " << surface
<< ", " << attribute
<< ", "
668 g_driver_egl
.debug_fn
.eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
669 GL_SERVICE_LOG("GL_RESULT: " << result
);
673 static EGLBoolean GL_BINDING_CALL
674 Debug_eglSwapBuffers(EGLDisplay dpy
, EGLSurface surface
) {
675 GL_SERVICE_LOG("eglSwapBuffers"
676 << "(" << dpy
<< ", " << surface
<< ")");
677 EGLBoolean result
= g_driver_egl
.debug_fn
.eglSwapBuffersFn(dpy
, surface
);
678 GL_SERVICE_LOG("GL_RESULT: " << result
);
682 static EGLBoolean GL_BINDING_CALL
683 Debug_eglSwapInterval(EGLDisplay dpy
, EGLint interval
) {
684 GL_SERVICE_LOG("eglSwapInterval"
685 << "(" << dpy
<< ", " << interval
<< ")");
686 EGLBoolean result
= g_driver_egl
.debug_fn
.eglSwapIntervalFn(dpy
, interval
);
687 GL_SERVICE_LOG("GL_RESULT: " << result
);
691 static EGLBoolean GL_BINDING_CALL
Debug_eglTerminate(EGLDisplay dpy
) {
692 GL_SERVICE_LOG("eglTerminate"
693 << "(" << dpy
<< ")");
694 EGLBoolean result
= g_driver_egl
.debug_fn
.eglTerminateFn(dpy
);
695 GL_SERVICE_LOG("GL_RESULT: " << result
);
699 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitClient(void) {
700 GL_SERVICE_LOG("eglWaitClient"
703 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitClientFn();
704 GL_SERVICE_LOG("GL_RESULT: " << result
);
708 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitGL(void) {
709 GL_SERVICE_LOG("eglWaitGL"
712 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitGLFn();
713 GL_SERVICE_LOG("GL_RESULT: " << result
);
717 static EGLBoolean GL_BINDING_CALL
Debug_eglWaitNative(EGLint engine
) {
718 GL_SERVICE_LOG("eglWaitNative"
719 << "(" << engine
<< ")");
720 EGLBoolean result
= g_driver_egl
.debug_fn
.eglWaitNativeFn(engine
);
721 GL_SERVICE_LOG("GL_RESULT: " << result
);
725 static EGLint GL_BINDING_CALL
726 Debug_eglWaitSyncKHR(EGLDisplay dpy
, EGLSyncKHR sync
, EGLint flags
) {
727 GL_SERVICE_LOG("eglWaitSyncKHR"
728 << "(" << dpy
<< ", " << sync
<< ", " << flags
<< ")");
729 EGLint result
= g_driver_egl
.debug_fn
.eglWaitSyncKHRFn(dpy
, sync
, flags
);
730 GL_SERVICE_LOG("GL_RESULT: " << result
);
735 void DriverEGL::InitializeDebugBindings() {
736 if (!debug_fn
.eglBindAPIFn
) {
737 debug_fn
.eglBindAPIFn
= fn
.eglBindAPIFn
;
738 fn
.eglBindAPIFn
= Debug_eglBindAPI
;
740 if (!debug_fn
.eglBindTexImageFn
) {
741 debug_fn
.eglBindTexImageFn
= fn
.eglBindTexImageFn
;
742 fn
.eglBindTexImageFn
= Debug_eglBindTexImage
;
744 if (!debug_fn
.eglChooseConfigFn
) {
745 debug_fn
.eglChooseConfigFn
= fn
.eglChooseConfigFn
;
746 fn
.eglChooseConfigFn
= Debug_eglChooseConfig
;
748 if (!debug_fn
.eglClientWaitSyncKHRFn
) {
749 debug_fn
.eglClientWaitSyncKHRFn
= fn
.eglClientWaitSyncKHRFn
;
750 fn
.eglClientWaitSyncKHRFn
= Debug_eglClientWaitSyncKHR
;
752 if (!debug_fn
.eglCopyBuffersFn
) {
753 debug_fn
.eglCopyBuffersFn
= fn
.eglCopyBuffersFn
;
754 fn
.eglCopyBuffersFn
= Debug_eglCopyBuffers
;
756 if (!debug_fn
.eglCreateContextFn
) {
757 debug_fn
.eglCreateContextFn
= fn
.eglCreateContextFn
;
758 fn
.eglCreateContextFn
= Debug_eglCreateContext
;
760 if (!debug_fn
.eglCreateImageKHRFn
) {
761 debug_fn
.eglCreateImageKHRFn
= fn
.eglCreateImageKHRFn
;
762 fn
.eglCreateImageKHRFn
= Debug_eglCreateImageKHR
;
764 if (!debug_fn
.eglCreatePbufferFromClientBufferFn
) {
765 debug_fn
.eglCreatePbufferFromClientBufferFn
=
766 fn
.eglCreatePbufferFromClientBufferFn
;
767 fn
.eglCreatePbufferFromClientBufferFn
=
768 Debug_eglCreatePbufferFromClientBuffer
;
770 if (!debug_fn
.eglCreatePbufferSurfaceFn
) {
771 debug_fn
.eglCreatePbufferSurfaceFn
= fn
.eglCreatePbufferSurfaceFn
;
772 fn
.eglCreatePbufferSurfaceFn
= Debug_eglCreatePbufferSurface
;
774 if (!debug_fn
.eglCreatePixmapSurfaceFn
) {
775 debug_fn
.eglCreatePixmapSurfaceFn
= fn
.eglCreatePixmapSurfaceFn
;
776 fn
.eglCreatePixmapSurfaceFn
= Debug_eglCreatePixmapSurface
;
778 if (!debug_fn
.eglCreateSyncKHRFn
) {
779 debug_fn
.eglCreateSyncKHRFn
= fn
.eglCreateSyncKHRFn
;
780 fn
.eglCreateSyncKHRFn
= Debug_eglCreateSyncKHR
;
782 if (!debug_fn
.eglCreateWindowSurfaceFn
) {
783 debug_fn
.eglCreateWindowSurfaceFn
= fn
.eglCreateWindowSurfaceFn
;
784 fn
.eglCreateWindowSurfaceFn
= Debug_eglCreateWindowSurface
;
786 if (!debug_fn
.eglDestroyContextFn
) {
787 debug_fn
.eglDestroyContextFn
= fn
.eglDestroyContextFn
;
788 fn
.eglDestroyContextFn
= Debug_eglDestroyContext
;
790 if (!debug_fn
.eglDestroyImageKHRFn
) {
791 debug_fn
.eglDestroyImageKHRFn
= fn
.eglDestroyImageKHRFn
;
792 fn
.eglDestroyImageKHRFn
= Debug_eglDestroyImageKHR
;
794 if (!debug_fn
.eglDestroySurfaceFn
) {
795 debug_fn
.eglDestroySurfaceFn
= fn
.eglDestroySurfaceFn
;
796 fn
.eglDestroySurfaceFn
= Debug_eglDestroySurface
;
798 if (!debug_fn
.eglDestroySyncKHRFn
) {
799 debug_fn
.eglDestroySyncKHRFn
= fn
.eglDestroySyncKHRFn
;
800 fn
.eglDestroySyncKHRFn
= Debug_eglDestroySyncKHR
;
802 if (!debug_fn
.eglGetConfigAttribFn
) {
803 debug_fn
.eglGetConfigAttribFn
= fn
.eglGetConfigAttribFn
;
804 fn
.eglGetConfigAttribFn
= Debug_eglGetConfigAttrib
;
806 if (!debug_fn
.eglGetConfigsFn
) {
807 debug_fn
.eglGetConfigsFn
= fn
.eglGetConfigsFn
;
808 fn
.eglGetConfigsFn
= Debug_eglGetConfigs
;
810 if (!debug_fn
.eglGetCurrentContextFn
) {
811 debug_fn
.eglGetCurrentContextFn
= fn
.eglGetCurrentContextFn
;
812 fn
.eglGetCurrentContextFn
= Debug_eglGetCurrentContext
;
814 if (!debug_fn
.eglGetCurrentDisplayFn
) {
815 debug_fn
.eglGetCurrentDisplayFn
= fn
.eglGetCurrentDisplayFn
;
816 fn
.eglGetCurrentDisplayFn
= Debug_eglGetCurrentDisplay
;
818 if (!debug_fn
.eglGetCurrentSurfaceFn
) {
819 debug_fn
.eglGetCurrentSurfaceFn
= fn
.eglGetCurrentSurfaceFn
;
820 fn
.eglGetCurrentSurfaceFn
= Debug_eglGetCurrentSurface
;
822 if (!debug_fn
.eglGetDisplayFn
) {
823 debug_fn
.eglGetDisplayFn
= fn
.eglGetDisplayFn
;
824 fn
.eglGetDisplayFn
= Debug_eglGetDisplay
;
826 if (!debug_fn
.eglGetErrorFn
) {
827 debug_fn
.eglGetErrorFn
= fn
.eglGetErrorFn
;
828 fn
.eglGetErrorFn
= Debug_eglGetError
;
830 if (!debug_fn
.eglGetPlatformDisplayEXTFn
) {
831 debug_fn
.eglGetPlatformDisplayEXTFn
= fn
.eglGetPlatformDisplayEXTFn
;
832 fn
.eglGetPlatformDisplayEXTFn
= Debug_eglGetPlatformDisplayEXT
;
834 if (!debug_fn
.eglGetProcAddressFn
) {
835 debug_fn
.eglGetProcAddressFn
= fn
.eglGetProcAddressFn
;
836 fn
.eglGetProcAddressFn
= Debug_eglGetProcAddress
;
838 if (!debug_fn
.eglGetSyncAttribKHRFn
) {
839 debug_fn
.eglGetSyncAttribKHRFn
= fn
.eglGetSyncAttribKHRFn
;
840 fn
.eglGetSyncAttribKHRFn
= Debug_eglGetSyncAttribKHR
;
842 if (!debug_fn
.eglGetSyncValuesCHROMIUMFn
) {
843 debug_fn
.eglGetSyncValuesCHROMIUMFn
= fn
.eglGetSyncValuesCHROMIUMFn
;
844 fn
.eglGetSyncValuesCHROMIUMFn
= Debug_eglGetSyncValuesCHROMIUM
;
846 if (!debug_fn
.eglInitializeFn
) {
847 debug_fn
.eglInitializeFn
= fn
.eglInitializeFn
;
848 fn
.eglInitializeFn
= Debug_eglInitialize
;
850 if (!debug_fn
.eglMakeCurrentFn
) {
851 debug_fn
.eglMakeCurrentFn
= fn
.eglMakeCurrentFn
;
852 fn
.eglMakeCurrentFn
= Debug_eglMakeCurrent
;
854 if (!debug_fn
.eglPostSubBufferNVFn
) {
855 debug_fn
.eglPostSubBufferNVFn
= fn
.eglPostSubBufferNVFn
;
856 fn
.eglPostSubBufferNVFn
= Debug_eglPostSubBufferNV
;
858 if (!debug_fn
.eglQueryAPIFn
) {
859 debug_fn
.eglQueryAPIFn
= fn
.eglQueryAPIFn
;
860 fn
.eglQueryAPIFn
= Debug_eglQueryAPI
;
862 if (!debug_fn
.eglQueryContextFn
) {
863 debug_fn
.eglQueryContextFn
= fn
.eglQueryContextFn
;
864 fn
.eglQueryContextFn
= Debug_eglQueryContext
;
866 if (!debug_fn
.eglQueryStringFn
) {
867 debug_fn
.eglQueryStringFn
= fn
.eglQueryStringFn
;
868 fn
.eglQueryStringFn
= Debug_eglQueryString
;
870 if (!debug_fn
.eglQuerySurfaceFn
) {
871 debug_fn
.eglQuerySurfaceFn
= fn
.eglQuerySurfaceFn
;
872 fn
.eglQuerySurfaceFn
= Debug_eglQuerySurface
;
874 if (!debug_fn
.eglQuerySurfacePointerANGLEFn
) {
875 debug_fn
.eglQuerySurfacePointerANGLEFn
= fn
.eglQuerySurfacePointerANGLEFn
;
876 fn
.eglQuerySurfacePointerANGLEFn
= Debug_eglQuerySurfacePointerANGLE
;
878 if (!debug_fn
.eglReleaseTexImageFn
) {
879 debug_fn
.eglReleaseTexImageFn
= fn
.eglReleaseTexImageFn
;
880 fn
.eglReleaseTexImageFn
= Debug_eglReleaseTexImage
;
882 if (!debug_fn
.eglReleaseThreadFn
) {
883 debug_fn
.eglReleaseThreadFn
= fn
.eglReleaseThreadFn
;
884 fn
.eglReleaseThreadFn
= Debug_eglReleaseThread
;
886 if (!debug_fn
.eglSurfaceAttribFn
) {
887 debug_fn
.eglSurfaceAttribFn
= fn
.eglSurfaceAttribFn
;
888 fn
.eglSurfaceAttribFn
= Debug_eglSurfaceAttrib
;
890 if (!debug_fn
.eglSwapBuffersFn
) {
891 debug_fn
.eglSwapBuffersFn
= fn
.eglSwapBuffersFn
;
892 fn
.eglSwapBuffersFn
= Debug_eglSwapBuffers
;
894 if (!debug_fn
.eglSwapIntervalFn
) {
895 debug_fn
.eglSwapIntervalFn
= fn
.eglSwapIntervalFn
;
896 fn
.eglSwapIntervalFn
= Debug_eglSwapInterval
;
898 if (!debug_fn
.eglTerminateFn
) {
899 debug_fn
.eglTerminateFn
= fn
.eglTerminateFn
;
900 fn
.eglTerminateFn
= Debug_eglTerminate
;
902 if (!debug_fn
.eglWaitClientFn
) {
903 debug_fn
.eglWaitClientFn
= fn
.eglWaitClientFn
;
904 fn
.eglWaitClientFn
= Debug_eglWaitClient
;
906 if (!debug_fn
.eglWaitGLFn
) {
907 debug_fn
.eglWaitGLFn
= fn
.eglWaitGLFn
;
908 fn
.eglWaitGLFn
= Debug_eglWaitGL
;
910 if (!debug_fn
.eglWaitNativeFn
) {
911 debug_fn
.eglWaitNativeFn
= fn
.eglWaitNativeFn
;
912 fn
.eglWaitNativeFn
= Debug_eglWaitNative
;
914 if (!debug_fn
.eglWaitSyncKHRFn
) {
915 debug_fn
.eglWaitSyncKHRFn
= fn
.eglWaitSyncKHRFn
;
916 fn
.eglWaitSyncKHRFn
= Debug_eglWaitSyncKHR
;
918 g_debugBindingsInitialized
= true;
921 void DriverEGL::ClearBindings() {
922 memset(this, 0, sizeof(*this));
925 EGLBoolean
EGLApiBase::eglBindAPIFn(EGLenum api
) {
926 return driver_
->fn
.eglBindAPIFn(api
);
929 EGLBoolean
EGLApiBase::eglBindTexImageFn(EGLDisplay dpy
,
932 return driver_
->fn
.eglBindTexImageFn(dpy
, surface
, buffer
);
935 EGLBoolean
EGLApiBase::eglChooseConfigFn(EGLDisplay dpy
,
936 const EGLint
* attrib_list
,
939 EGLint
* num_config
) {
940 return driver_
->fn
.eglChooseConfigFn(dpy
, attrib_list
, configs
, config_size
,
944 EGLint
EGLApiBase::eglClientWaitSyncKHRFn(EGLDisplay dpy
,
947 EGLTimeKHR timeout
) {
948 return driver_
->fn
.eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
951 EGLBoolean
EGLApiBase::eglCopyBuffersFn(EGLDisplay dpy
,
953 EGLNativePixmapType target
) {
954 return driver_
->fn
.eglCopyBuffersFn(dpy
, surface
, target
);
957 EGLContext
EGLApiBase::eglCreateContextFn(EGLDisplay dpy
,
959 EGLContext share_context
,
960 const EGLint
* attrib_list
) {
961 return driver_
->fn
.eglCreateContextFn(dpy
, config
, share_context
,
965 EGLImageKHR
EGLApiBase::eglCreateImageKHRFn(EGLDisplay dpy
,
968 EGLClientBuffer buffer
,
969 const EGLint
* attrib_list
) {
970 return driver_
->fn
.eglCreateImageKHRFn(dpy
, ctx
, target
, buffer
, attrib_list
);
973 EGLSurface
EGLApiBase::eglCreatePbufferFromClientBufferFn(
978 const EGLint
* attrib_list
) {
979 return driver_
->fn
.eglCreatePbufferFromClientBufferFn(dpy
, buftype
, buffer
,
980 config
, attrib_list
);
983 EGLSurface
EGLApiBase::eglCreatePbufferSurfaceFn(EGLDisplay dpy
,
985 const EGLint
* attrib_list
) {
986 return driver_
->fn
.eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
989 EGLSurface
EGLApiBase::eglCreatePixmapSurfaceFn(EGLDisplay dpy
,
991 EGLNativePixmapType pixmap
,
992 const EGLint
* attrib_list
) {
993 return driver_
->fn
.eglCreatePixmapSurfaceFn(dpy
, config
, pixmap
, attrib_list
);
996 EGLSyncKHR
EGLApiBase::eglCreateSyncKHRFn(EGLDisplay dpy
,
998 const EGLint
* attrib_list
) {
999 return driver_
->fn
.eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
1002 EGLSurface
EGLApiBase::eglCreateWindowSurfaceFn(EGLDisplay dpy
,
1004 EGLNativeWindowType win
,
1005 const EGLint
* attrib_list
) {
1006 return driver_
->fn
.eglCreateWindowSurfaceFn(dpy
, config
, win
, attrib_list
);
1009 EGLBoolean
EGLApiBase::eglDestroyContextFn(EGLDisplay dpy
, EGLContext ctx
) {
1010 return driver_
->fn
.eglDestroyContextFn(dpy
, ctx
);
1013 EGLBoolean
EGLApiBase::eglDestroyImageKHRFn(EGLDisplay dpy
, EGLImageKHR image
) {
1014 return driver_
->fn
.eglDestroyImageKHRFn(dpy
, image
);
1017 EGLBoolean
EGLApiBase::eglDestroySurfaceFn(EGLDisplay dpy
, EGLSurface surface
) {
1018 return driver_
->fn
.eglDestroySurfaceFn(dpy
, surface
);
1021 EGLBoolean
EGLApiBase::eglDestroySyncKHRFn(EGLDisplay dpy
, EGLSyncKHR sync
) {
1022 return driver_
->fn
.eglDestroySyncKHRFn(dpy
, sync
);
1025 EGLBoolean
EGLApiBase::eglGetConfigAttribFn(EGLDisplay dpy
,
1029 return driver_
->fn
.eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
1032 EGLBoolean
EGLApiBase::eglGetConfigsFn(EGLDisplay dpy
,
1035 EGLint
* num_config
) {
1036 return driver_
->fn
.eglGetConfigsFn(dpy
, configs
, config_size
, num_config
);
1039 EGLContext
EGLApiBase::eglGetCurrentContextFn(void) {
1040 return driver_
->fn
.eglGetCurrentContextFn();
1043 EGLDisplay
EGLApiBase::eglGetCurrentDisplayFn(void) {
1044 return driver_
->fn
.eglGetCurrentDisplayFn();
1047 EGLSurface
EGLApiBase::eglGetCurrentSurfaceFn(EGLint readdraw
) {
1048 return driver_
->fn
.eglGetCurrentSurfaceFn(readdraw
);
1051 EGLDisplay
EGLApiBase::eglGetDisplayFn(EGLNativeDisplayType display_id
) {
1052 return driver_
->fn
.eglGetDisplayFn(display_id
);
1055 EGLint
EGLApiBase::eglGetErrorFn(void) {
1056 return driver_
->fn
.eglGetErrorFn();
1059 EGLDisplay
EGLApiBase::eglGetPlatformDisplayEXTFn(EGLenum platform
,
1060 void* native_display
,
1061 const EGLint
* attrib_list
) {
1062 return driver_
->fn
.eglGetPlatformDisplayEXTFn(platform
, native_display
,
1066 __eglMustCastToProperFunctionPointerType
EGLApiBase::eglGetProcAddressFn(
1067 const char* procname
) {
1068 return driver_
->fn
.eglGetProcAddressFn(procname
);
1071 EGLBoolean
EGLApiBase::eglGetSyncAttribKHRFn(EGLDisplay dpy
,
1075 return driver_
->fn
.eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
1078 EGLBoolean
EGLApiBase::eglGetSyncValuesCHROMIUMFn(EGLDisplay dpy
,
1080 EGLuint64CHROMIUM
* ust
,
1081 EGLuint64CHROMIUM
* msc
,
1082 EGLuint64CHROMIUM
* sbc
) {
1083 return driver_
->fn
.eglGetSyncValuesCHROMIUMFn(dpy
, surface
, ust
, msc
, sbc
);
1086 EGLBoolean
EGLApiBase::eglInitializeFn(EGLDisplay dpy
,
1089 return driver_
->fn
.eglInitializeFn(dpy
, major
, minor
);
1092 EGLBoolean
EGLApiBase::eglMakeCurrentFn(EGLDisplay dpy
,
1096 return driver_
->fn
.eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
1099 EGLBoolean
EGLApiBase::eglPostSubBufferNVFn(EGLDisplay dpy
,
1105 return driver_
->fn
.eglPostSubBufferNVFn(dpy
, surface
, x
, y
, width
, height
);
1108 EGLenum
EGLApiBase::eglQueryAPIFn(void) {
1109 return driver_
->fn
.eglQueryAPIFn();
1112 EGLBoolean
EGLApiBase::eglQueryContextFn(EGLDisplay dpy
,
1116 return driver_
->fn
.eglQueryContextFn(dpy
, ctx
, attribute
, value
);
1119 const char* EGLApiBase::eglQueryStringFn(EGLDisplay dpy
, EGLint name
) {
1120 return driver_
->fn
.eglQueryStringFn(dpy
, name
);
1123 EGLBoolean
EGLApiBase::eglQuerySurfaceFn(EGLDisplay dpy
,
1127 return driver_
->fn
.eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
1130 EGLBoolean
EGLApiBase::eglQuerySurfacePointerANGLEFn(EGLDisplay dpy
,
1134 return driver_
->fn
.eglQuerySurfacePointerANGLEFn(dpy
, surface
, attribute
,
1138 EGLBoolean
EGLApiBase::eglReleaseTexImageFn(EGLDisplay dpy
,
1141 return driver_
->fn
.eglReleaseTexImageFn(dpy
, surface
, buffer
);
1144 EGLBoolean
EGLApiBase::eglReleaseThreadFn(void) {
1145 return driver_
->fn
.eglReleaseThreadFn();
1148 EGLBoolean
EGLApiBase::eglSurfaceAttribFn(EGLDisplay dpy
,
1152 return driver_
->fn
.eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
1155 EGLBoolean
EGLApiBase::eglSwapBuffersFn(EGLDisplay dpy
, EGLSurface surface
) {
1156 return driver_
->fn
.eglSwapBuffersFn(dpy
, surface
);
1159 EGLBoolean
EGLApiBase::eglSwapIntervalFn(EGLDisplay dpy
, EGLint interval
) {
1160 return driver_
->fn
.eglSwapIntervalFn(dpy
, interval
);
1163 EGLBoolean
EGLApiBase::eglTerminateFn(EGLDisplay dpy
) {
1164 return driver_
->fn
.eglTerminateFn(dpy
);
1167 EGLBoolean
EGLApiBase::eglWaitClientFn(void) {
1168 return driver_
->fn
.eglWaitClientFn();
1171 EGLBoolean
EGLApiBase::eglWaitGLFn(void) {
1172 return driver_
->fn
.eglWaitGLFn();
1175 EGLBoolean
EGLApiBase::eglWaitNativeFn(EGLint engine
) {
1176 return driver_
->fn
.eglWaitNativeFn(engine
);
1179 EGLint
EGLApiBase::eglWaitSyncKHRFn(EGLDisplay dpy
,
1182 return driver_
->fn
.eglWaitSyncKHRFn(dpy
, sync
, flags
);
1185 EGLBoolean
TraceEGLApi::eglBindAPIFn(EGLenum api
) {
1186 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglBindAPI")
1187 return egl_api_
->eglBindAPIFn(api
);
1190 EGLBoolean
TraceEGLApi::eglBindTexImageFn(EGLDisplay dpy
,
1193 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglBindTexImage")
1194 return egl_api_
->eglBindTexImageFn(dpy
, surface
, buffer
);
1197 EGLBoolean
TraceEGLApi::eglChooseConfigFn(EGLDisplay dpy
,
1198 const EGLint
* attrib_list
,
1201 EGLint
* num_config
) {
1202 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglChooseConfig")
1203 return egl_api_
->eglChooseConfigFn(dpy
, attrib_list
, configs
, config_size
,
1207 EGLint
TraceEGLApi::eglClientWaitSyncKHRFn(EGLDisplay dpy
,
1210 EGLTimeKHR timeout
) {
1211 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglClientWaitSyncKHR")
1212 return egl_api_
->eglClientWaitSyncKHRFn(dpy
, sync
, flags
, timeout
);
1215 EGLBoolean
TraceEGLApi::eglCopyBuffersFn(EGLDisplay dpy
,
1217 EGLNativePixmapType target
) {
1218 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCopyBuffers")
1219 return egl_api_
->eglCopyBuffersFn(dpy
, surface
, target
);
1222 EGLContext
TraceEGLApi::eglCreateContextFn(EGLDisplay dpy
,
1224 EGLContext share_context
,
1225 const EGLint
* attrib_list
) {
1226 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateContext")
1227 return egl_api_
->eglCreateContextFn(dpy
, config
, share_context
, attrib_list
);
1230 EGLImageKHR
TraceEGLApi::eglCreateImageKHRFn(EGLDisplay dpy
,
1233 EGLClientBuffer buffer
,
1234 const EGLint
* attrib_list
) {
1235 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateImageKHR")
1236 return egl_api_
->eglCreateImageKHRFn(dpy
, ctx
, target
, buffer
, attrib_list
);
1239 EGLSurface
TraceEGLApi::eglCreatePbufferFromClientBufferFn(
1244 const EGLint
* attrib_list
) {
1245 TRACE_EVENT_BINARY_EFFICIENT0("gpu",
1246 "TraceGLAPI::eglCreatePbufferFromClientBuffer")
1247 return egl_api_
->eglCreatePbufferFromClientBufferFn(dpy
, buftype
, buffer
,
1248 config
, attrib_list
);
1251 EGLSurface
TraceEGLApi::eglCreatePbufferSurfaceFn(EGLDisplay dpy
,
1253 const EGLint
* attrib_list
) {
1254 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreatePbufferSurface")
1255 return egl_api_
->eglCreatePbufferSurfaceFn(dpy
, config
, attrib_list
);
1258 EGLSurface
TraceEGLApi::eglCreatePixmapSurfaceFn(EGLDisplay dpy
,
1260 EGLNativePixmapType pixmap
,
1261 const EGLint
* attrib_list
) {
1262 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreatePixmapSurface")
1263 return egl_api_
->eglCreatePixmapSurfaceFn(dpy
, config
, pixmap
, attrib_list
);
1266 EGLSyncKHR
TraceEGLApi::eglCreateSyncKHRFn(EGLDisplay dpy
,
1268 const EGLint
* attrib_list
) {
1269 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateSyncKHR")
1270 return egl_api_
->eglCreateSyncKHRFn(dpy
, type
, attrib_list
);
1273 EGLSurface
TraceEGLApi::eglCreateWindowSurfaceFn(EGLDisplay dpy
,
1275 EGLNativeWindowType win
,
1276 const EGLint
* attrib_list
) {
1277 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglCreateWindowSurface")
1278 return egl_api_
->eglCreateWindowSurfaceFn(dpy
, config
, win
, attrib_list
);
1281 EGLBoolean
TraceEGLApi::eglDestroyContextFn(EGLDisplay dpy
, EGLContext ctx
) {
1282 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroyContext")
1283 return egl_api_
->eglDestroyContextFn(dpy
, ctx
);
1286 EGLBoolean
TraceEGLApi::eglDestroyImageKHRFn(EGLDisplay dpy
,
1287 EGLImageKHR image
) {
1288 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroyImageKHR")
1289 return egl_api_
->eglDestroyImageKHRFn(dpy
, image
);
1292 EGLBoolean
TraceEGLApi::eglDestroySurfaceFn(EGLDisplay dpy
,
1293 EGLSurface surface
) {
1294 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroySurface")
1295 return egl_api_
->eglDestroySurfaceFn(dpy
, surface
);
1298 EGLBoolean
TraceEGLApi::eglDestroySyncKHRFn(EGLDisplay dpy
, EGLSyncKHR sync
) {
1299 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglDestroySyncKHR")
1300 return egl_api_
->eglDestroySyncKHRFn(dpy
, sync
);
1303 EGLBoolean
TraceEGLApi::eglGetConfigAttribFn(EGLDisplay dpy
,
1307 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetConfigAttrib")
1308 return egl_api_
->eglGetConfigAttribFn(dpy
, config
, attribute
, value
);
1311 EGLBoolean
TraceEGLApi::eglGetConfigsFn(EGLDisplay dpy
,
1314 EGLint
* num_config
) {
1315 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetConfigs")
1316 return egl_api_
->eglGetConfigsFn(dpy
, configs
, config_size
, num_config
);
1319 EGLContext
TraceEGLApi::eglGetCurrentContextFn(void) {
1320 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentContext")
1321 return egl_api_
->eglGetCurrentContextFn();
1324 EGLDisplay
TraceEGLApi::eglGetCurrentDisplayFn(void) {
1325 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentDisplay")
1326 return egl_api_
->eglGetCurrentDisplayFn();
1329 EGLSurface
TraceEGLApi::eglGetCurrentSurfaceFn(EGLint readdraw
) {
1330 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetCurrentSurface")
1331 return egl_api_
->eglGetCurrentSurfaceFn(readdraw
);
1334 EGLDisplay
TraceEGLApi::eglGetDisplayFn(EGLNativeDisplayType display_id
) {
1335 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetDisplay")
1336 return egl_api_
->eglGetDisplayFn(display_id
);
1339 EGLint
TraceEGLApi::eglGetErrorFn(void) {
1340 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetError")
1341 return egl_api_
->eglGetErrorFn();
1344 EGLDisplay
TraceEGLApi::eglGetPlatformDisplayEXTFn(EGLenum platform
,
1345 void* native_display
,
1346 const EGLint
* attrib_list
) {
1347 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetPlatformDisplayEXT")
1348 return egl_api_
->eglGetPlatformDisplayEXTFn(platform
, native_display
,
1352 __eglMustCastToProperFunctionPointerType
TraceEGLApi::eglGetProcAddressFn(
1353 const char* procname
) {
1354 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetProcAddress")
1355 return egl_api_
->eglGetProcAddressFn(procname
);
1358 EGLBoolean
TraceEGLApi::eglGetSyncAttribKHRFn(EGLDisplay dpy
,
1362 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetSyncAttribKHR")
1363 return egl_api_
->eglGetSyncAttribKHRFn(dpy
, sync
, attribute
, value
);
1366 EGLBoolean
TraceEGLApi::eglGetSyncValuesCHROMIUMFn(EGLDisplay dpy
,
1368 EGLuint64CHROMIUM
* ust
,
1369 EGLuint64CHROMIUM
* msc
,
1370 EGLuint64CHROMIUM
* sbc
) {
1371 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglGetSyncValuesCHROMIUM")
1372 return egl_api_
->eglGetSyncValuesCHROMIUMFn(dpy
, surface
, ust
, msc
, sbc
);
1375 EGLBoolean
TraceEGLApi::eglInitializeFn(EGLDisplay dpy
,
1378 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglInitialize")
1379 return egl_api_
->eglInitializeFn(dpy
, major
, minor
);
1382 EGLBoolean
TraceEGLApi::eglMakeCurrentFn(EGLDisplay dpy
,
1386 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglMakeCurrent")
1387 return egl_api_
->eglMakeCurrentFn(dpy
, draw
, read
, ctx
);
1390 EGLBoolean
TraceEGLApi::eglPostSubBufferNVFn(EGLDisplay dpy
,
1396 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglPostSubBufferNV")
1397 return egl_api_
->eglPostSubBufferNVFn(dpy
, surface
, x
, y
, width
, height
);
1400 EGLenum
TraceEGLApi::eglQueryAPIFn(void) {
1401 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryAPI")
1402 return egl_api_
->eglQueryAPIFn();
1405 EGLBoolean
TraceEGLApi::eglQueryContextFn(EGLDisplay dpy
,
1409 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryContext")
1410 return egl_api_
->eglQueryContextFn(dpy
, ctx
, attribute
, value
);
1413 const char* TraceEGLApi::eglQueryStringFn(EGLDisplay dpy
, EGLint name
) {
1414 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQueryString")
1415 return egl_api_
->eglQueryStringFn(dpy
, name
);
1418 EGLBoolean
TraceEGLApi::eglQuerySurfaceFn(EGLDisplay dpy
,
1422 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglQuerySurface")
1423 return egl_api_
->eglQuerySurfaceFn(dpy
, surface
, attribute
, value
);
1426 EGLBoolean
TraceEGLApi::eglQuerySurfacePointerANGLEFn(EGLDisplay dpy
,
1430 TRACE_EVENT_BINARY_EFFICIENT0("gpu",
1431 "TraceGLAPI::eglQuerySurfacePointerANGLE")
1432 return egl_api_
->eglQuerySurfacePointerANGLEFn(dpy
, surface
, attribute
,
1436 EGLBoolean
TraceEGLApi::eglReleaseTexImageFn(EGLDisplay dpy
,
1439 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglReleaseTexImage")
1440 return egl_api_
->eglReleaseTexImageFn(dpy
, surface
, buffer
);
1443 EGLBoolean
TraceEGLApi::eglReleaseThreadFn(void) {
1444 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglReleaseThread")
1445 return egl_api_
->eglReleaseThreadFn();
1448 EGLBoolean
TraceEGLApi::eglSurfaceAttribFn(EGLDisplay dpy
,
1452 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSurfaceAttrib")
1453 return egl_api_
->eglSurfaceAttribFn(dpy
, surface
, attribute
, value
);
1456 EGLBoolean
TraceEGLApi::eglSwapBuffersFn(EGLDisplay dpy
, EGLSurface surface
) {
1457 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSwapBuffers")
1458 return egl_api_
->eglSwapBuffersFn(dpy
, surface
);
1461 EGLBoolean
TraceEGLApi::eglSwapIntervalFn(EGLDisplay dpy
, EGLint interval
) {
1462 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglSwapInterval")
1463 return egl_api_
->eglSwapIntervalFn(dpy
, interval
);
1466 EGLBoolean
TraceEGLApi::eglTerminateFn(EGLDisplay dpy
) {
1467 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglTerminate")
1468 return egl_api_
->eglTerminateFn(dpy
);
1471 EGLBoolean
TraceEGLApi::eglWaitClientFn(void) {
1472 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitClient")
1473 return egl_api_
->eglWaitClientFn();
1476 EGLBoolean
TraceEGLApi::eglWaitGLFn(void) {
1477 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitGL")
1478 return egl_api_
->eglWaitGLFn();
1481 EGLBoolean
TraceEGLApi::eglWaitNativeFn(EGLint engine
) {
1482 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitNative")
1483 return egl_api_
->eglWaitNativeFn(engine
);
1486 EGLint
TraceEGLApi::eglWaitSyncKHRFn(EGLDisplay dpy
,
1489 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::eglWaitSyncKHR")
1490 return egl_api_
->eglWaitSyncKHRFn(dpy
, sync
, flags
);