OLD | NEW |
(Empty) | |
| 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. |
| 4 // |
| 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 |
| 9 // DO NOT EDIT! |
| 10 |
| 11 #include <string> |
| 12 |
| 13 #include "base/debug/trace_event.h" |
| 14 #include "ui/gl/gl_bindings.h" |
| 15 #include "ui/gl/gl_context.h" |
| 16 #include "ui/gl/gl_enums.h" |
| 17 #include "ui/gl/gl_glx_api_implementation.h" |
| 18 #include "ui/gl/gl_implementation.h" |
| 19 #include "ui/gl/gl_version_info.h" |
| 20 |
| 21 namespace gfx { |
| 22 |
| 23 static bool g_debugBindingsInitialized; |
| 24 DriverGLX g_driver_glx; |
| 25 |
| 26 void DriverGLX::InitializeStaticBindings() { |
| 27 fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>( |
| 28 GetGLProcAddress("glXBindTexImageEXT")); |
| 29 fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>( |
| 30 GetGLProcAddress("glXChooseFBConfig")); |
| 31 fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>( |
| 32 GetGLProcAddress("glXChooseVisual")); |
| 33 fn.glXCopyContextFn = |
| 34 reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext")); |
| 35 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>( |
| 36 GetGLProcAddress("glXCopySubBufferMESA")); |
| 37 fn.glXCreateContextFn = reinterpret_cast<glXCreateContextProc>( |
| 38 GetGLProcAddress("glXCreateContext")); |
| 39 fn.glXCreateContextAttribsARBFn = |
| 40 reinterpret_cast<glXCreateContextAttribsARBProc>( |
| 41 GetGLProcAddress("glXCreateContextAttribsARB")); |
| 42 fn.glXCreateGLXPixmapFn = reinterpret_cast<glXCreateGLXPixmapProc>( |
| 43 GetGLProcAddress("glXCreateGLXPixmap")); |
| 44 fn.glXCreateNewContextFn = reinterpret_cast<glXCreateNewContextProc>( |
| 45 GetGLProcAddress("glXCreateNewContext")); |
| 46 fn.glXCreatePbufferFn = reinterpret_cast<glXCreatePbufferProc>( |
| 47 GetGLProcAddress("glXCreatePbuffer")); |
| 48 fn.glXCreatePixmapFn = reinterpret_cast<glXCreatePixmapProc>( |
| 49 GetGLProcAddress("glXCreatePixmap")); |
| 50 fn.glXCreateWindowFn = reinterpret_cast<glXCreateWindowProc>( |
| 51 GetGLProcAddress("glXCreateWindow")); |
| 52 fn.glXDestroyContextFn = reinterpret_cast<glXDestroyContextProc>( |
| 53 GetGLProcAddress("glXDestroyContext")); |
| 54 fn.glXDestroyGLXPixmapFn = reinterpret_cast<glXDestroyGLXPixmapProc>( |
| 55 GetGLProcAddress("glXDestroyGLXPixmap")); |
| 56 fn.glXDestroyPbufferFn = reinterpret_cast<glXDestroyPbufferProc>( |
| 57 GetGLProcAddress("glXDestroyPbuffer")); |
| 58 fn.glXDestroyPixmapFn = reinterpret_cast<glXDestroyPixmapProc>( |
| 59 GetGLProcAddress("glXDestroyPixmap")); |
| 60 fn.glXDestroyWindowFn = reinterpret_cast<glXDestroyWindowProc>( |
| 61 GetGLProcAddress("glXDestroyWindow")); |
| 62 fn.glXGetClientStringFn = reinterpret_cast<glXGetClientStringProc>( |
| 63 GetGLProcAddress("glXGetClientString")); |
| 64 fn.glXGetConfigFn = |
| 65 reinterpret_cast<glXGetConfigProc>(GetGLProcAddress("glXGetConfig")); |
| 66 fn.glXGetCurrentContextFn = reinterpret_cast<glXGetCurrentContextProc>( |
| 67 GetGLProcAddress("glXGetCurrentContext")); |
| 68 fn.glXGetCurrentDisplayFn = reinterpret_cast<glXGetCurrentDisplayProc>( |
| 69 GetGLProcAddress("glXGetCurrentDisplay")); |
| 70 fn.glXGetCurrentDrawableFn = reinterpret_cast<glXGetCurrentDrawableProc>( |
| 71 GetGLProcAddress("glXGetCurrentDrawable")); |
| 72 fn.glXGetCurrentReadDrawableFn = |
| 73 reinterpret_cast<glXGetCurrentReadDrawableProc>( |
| 74 GetGLProcAddress("glXGetCurrentReadDrawable")); |
| 75 fn.glXGetFBConfigAttribFn = reinterpret_cast<glXGetFBConfigAttribProc>( |
| 76 GetGLProcAddress("glXGetFBConfigAttrib")); |
| 77 fn.glXGetFBConfigFromVisualSGIXFn = |
| 78 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( |
| 79 GetGLProcAddress("glXGetFBConfigFromVisualSGIX")); |
| 80 fn.glXGetFBConfigsFn = reinterpret_cast<glXGetFBConfigsProc>( |
| 81 GetGLProcAddress("glXGetFBConfigs")); |
| 82 fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>( |
| 83 GetGLProcAddress("glXGetMscRateOML")); |
| 84 fn.glXGetSelectedEventFn = reinterpret_cast<glXGetSelectedEventProc>( |
| 85 GetGLProcAddress("glXGetSelectedEvent")); |
| 86 fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>( |
| 87 GetGLProcAddress("glXGetSyncValuesOML")); |
| 88 fn.glXGetVisualFromFBConfigFn = |
| 89 reinterpret_cast<glXGetVisualFromFBConfigProc>( |
| 90 GetGLProcAddress("glXGetVisualFromFBConfig")); |
| 91 fn.glXIsDirectFn = |
| 92 reinterpret_cast<glXIsDirectProc>(GetGLProcAddress("glXIsDirect")); |
| 93 fn.glXMakeContextCurrentFn = reinterpret_cast<glXMakeContextCurrentProc>( |
| 94 GetGLProcAddress("glXMakeContextCurrent")); |
| 95 fn.glXMakeCurrentFn = |
| 96 reinterpret_cast<glXMakeCurrentProc>(GetGLProcAddress("glXMakeCurrent")); |
| 97 fn.glXQueryContextFn = reinterpret_cast<glXQueryContextProc>( |
| 98 GetGLProcAddress("glXQueryContext")); |
| 99 fn.glXQueryDrawableFn = reinterpret_cast<glXQueryDrawableProc>( |
| 100 GetGLProcAddress("glXQueryDrawable")); |
| 101 fn.glXQueryExtensionFn = reinterpret_cast<glXQueryExtensionProc>( |
| 102 GetGLProcAddress("glXQueryExtension")); |
| 103 fn.glXQueryExtensionsStringFn = |
| 104 reinterpret_cast<glXQueryExtensionsStringProc>( |
| 105 GetGLProcAddress("glXQueryExtensionsString")); |
| 106 fn.glXQueryServerStringFn = reinterpret_cast<glXQueryServerStringProc>( |
| 107 GetGLProcAddress("glXQueryServerString")); |
| 108 fn.glXQueryVersionFn = reinterpret_cast<glXQueryVersionProc>( |
| 109 GetGLProcAddress("glXQueryVersion")); |
| 110 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( |
| 111 GetGLProcAddress("glXReleaseTexImageEXT")); |
| 112 fn.glXSelectEventFn = |
| 113 reinterpret_cast<glXSelectEventProc>(GetGLProcAddress("glXSelectEvent")); |
| 114 fn.glXSwapBuffersFn = |
| 115 reinterpret_cast<glXSwapBuffersProc>(GetGLProcAddress("glXSwapBuffers")); |
| 116 fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>( |
| 117 GetGLProcAddress("glXSwapIntervalEXT")); |
| 118 fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>( |
| 119 GetGLProcAddress("glXSwapIntervalMESA")); |
| 120 fn.glXUseXFontFn = |
| 121 reinterpret_cast<glXUseXFontProc>(GetGLProcAddress("glXUseXFont")); |
| 122 fn.glXWaitGLFn = |
| 123 reinterpret_cast<glXWaitGLProc>(GetGLProcAddress("glXWaitGL")); |
| 124 fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>( |
| 125 GetGLProcAddress("glXWaitVideoSyncSGI")); |
| 126 fn.glXWaitXFn = reinterpret_cast<glXWaitXProc>(GetGLProcAddress("glXWaitX")); |
| 127 } |
| 128 |
| 129 void DriverGLX::InitializeDynamicBindings(GLContext* context) { |
| 130 DCHECK(context && context->IsCurrent(NULL)); |
| 131 const GLVersionInfo* ver = context->GetVersionInfo(); |
| 132 ALLOW_UNUSED_LOCAL(ver); |
| 133 std::string extensions = context->GetExtensions() + " "; |
| 134 ALLOW_UNUSED_LOCAL(extensions); |
| 135 |
| 136 ext.b_GLX_ARB_create_context = |
| 137 extensions.find("GLX_ARB_create_context ") != std::string::npos; |
| 138 ext.b_GLX_EXT_swap_control = |
| 139 extensions.find("GLX_EXT_swap_control ") != std::string::npos; |
| 140 ext.b_GLX_EXT_texture_from_pixmap = |
| 141 extensions.find("GLX_EXT_texture_from_pixmap ") != std::string::npos; |
| 142 ext.b_GLX_MESA_copy_sub_buffer = |
| 143 extensions.find("GLX_MESA_copy_sub_buffer ") != std::string::npos; |
| 144 ext.b_GLX_MESA_swap_control = |
| 145 extensions.find("GLX_MESA_swap_control ") != std::string::npos; |
| 146 ext.b_GLX_OML_sync_control = |
| 147 extensions.find("GLX_OML_sync_control ") != std::string::npos; |
| 148 ext.b_GLX_SGIX_fbconfig = |
| 149 extensions.find("GLX_SGIX_fbconfig ") != std::string::npos; |
| 150 ext.b_GLX_SGI_video_sync = |
| 151 extensions.find("GLX_SGI_video_sync ") != std::string::npos; |
| 152 |
| 153 if (g_debugBindingsInitialized) |
| 154 InitializeDebugBindings(); |
| 155 } |
| 156 |
| 157 extern "C" { |
| 158 |
| 159 static void GL_BINDING_CALL Debug_glXBindTexImageEXT(Display* dpy, |
| 160 GLXDrawable drawable, |
| 161 int buffer, |
| 162 int* attribList) { |
| 163 GL_SERVICE_LOG("glXBindTexImageEXT" |
| 164 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 165 << ", " << buffer << ", " |
| 166 << static_cast<const void*>(attribList) << ")"); |
| 167 g_driver_glx.debug_fn.glXBindTexImageEXTFn(dpy, drawable, buffer, attribList); |
| 168 } |
| 169 |
| 170 static GLXFBConfig* GL_BINDING_CALL |
| 171 Debug_glXChooseFBConfig(Display* dpy, |
| 172 int screen, |
| 173 const int* attribList, |
| 174 int* nitems) { |
| 175 GL_SERVICE_LOG("glXChooseFBConfig" |
| 176 << "(" << static_cast<const void*>(dpy) << ", " << screen |
| 177 << ", " << static_cast<const void*>(attribList) << ", " |
| 178 << static_cast<const void*>(nitems) << ")"); |
| 179 GLXFBConfig* result = g_driver_glx.debug_fn.glXChooseFBConfigFn( |
| 180 dpy, screen, attribList, nitems); |
| 181 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 182 return result; |
| 183 } |
| 184 |
| 185 static XVisualInfo* GL_BINDING_CALL |
| 186 Debug_glXChooseVisual(Display* dpy, int screen, int* attribList) { |
| 187 GL_SERVICE_LOG("glXChooseVisual" |
| 188 << "(" << static_cast<const void*>(dpy) << ", " << screen |
| 189 << ", " << static_cast<const void*>(attribList) << ")"); |
| 190 XVisualInfo* result = |
| 191 g_driver_glx.debug_fn.glXChooseVisualFn(dpy, screen, attribList); |
| 192 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 193 return result; |
| 194 } |
| 195 |
| 196 static void GL_BINDING_CALL Debug_glXCopyContext(Display* dpy, |
| 197 GLXContext src, |
| 198 GLXContext dst, |
| 199 unsigned long mask) { |
| 200 GL_SERVICE_LOG("glXCopyContext" |
| 201 << "(" << static_cast<const void*>(dpy) << ", " << src << ", " |
| 202 << dst << ", " << mask << ")"); |
| 203 g_driver_glx.debug_fn.glXCopyContextFn(dpy, src, dst, mask); |
| 204 } |
| 205 |
| 206 static void GL_BINDING_CALL Debug_glXCopySubBufferMESA(Display* dpy, |
| 207 GLXDrawable drawable, |
| 208 int x, |
| 209 int y, |
| 210 int width, |
| 211 int height) { |
| 212 GL_SERVICE_LOG("glXCopySubBufferMESA" |
| 213 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 214 << ", " << x << ", " << y << ", " << width << ", " << height |
| 215 << ")"); |
| 216 g_driver_glx.debug_fn.glXCopySubBufferMESAFn(dpy, drawable, x, y, width, |
| 217 height); |
| 218 } |
| 219 |
| 220 static GLXContext GL_BINDING_CALL Debug_glXCreateContext(Display* dpy, |
| 221 XVisualInfo* vis, |
| 222 GLXContext shareList, |
| 223 int direct) { |
| 224 GL_SERVICE_LOG("glXCreateContext" |
| 225 << "(" << static_cast<const void*>(dpy) << ", " |
| 226 << static_cast<const void*>(vis) << ", " << shareList << ", " |
| 227 << direct << ")"); |
| 228 GLXContext result = |
| 229 g_driver_glx.debug_fn.glXCreateContextFn(dpy, vis, shareList, direct); |
| 230 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 231 return result; |
| 232 } |
| 233 |
| 234 static GLXContext GL_BINDING_CALL |
| 235 Debug_glXCreateContextAttribsARB(Display* dpy, |
| 236 GLXFBConfig config, |
| 237 GLXContext share_context, |
| 238 int direct, |
| 239 const int* attrib_list) { |
| 240 GL_SERVICE_LOG("glXCreateContextAttribsARB" |
| 241 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 242 << ", " << share_context << ", " << direct << ", " |
| 243 << static_cast<const void*>(attrib_list) << ")"); |
| 244 GLXContext result = g_driver_glx.debug_fn.glXCreateContextAttribsARBFn( |
| 245 dpy, config, share_context, direct, attrib_list); |
| 246 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 247 return result; |
| 248 } |
| 249 |
| 250 static GLXPixmap GL_BINDING_CALL |
| 251 Debug_glXCreateGLXPixmap(Display* dpy, XVisualInfo* visual, Pixmap pixmap) { |
| 252 GL_SERVICE_LOG("glXCreateGLXPixmap" |
| 253 << "(" << static_cast<const void*>(dpy) << ", " |
| 254 << static_cast<const void*>(visual) << ", " << pixmap << ")"); |
| 255 GLXPixmap result = |
| 256 g_driver_glx.debug_fn.glXCreateGLXPixmapFn(dpy, visual, pixmap); |
| 257 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 258 return result; |
| 259 } |
| 260 |
| 261 static GLXContext GL_BINDING_CALL |
| 262 Debug_glXCreateNewContext(Display* dpy, |
| 263 GLXFBConfig config, |
| 264 int renderType, |
| 265 GLXContext shareList, |
| 266 int direct) { |
| 267 GL_SERVICE_LOG("glXCreateNewContext" |
| 268 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 269 << ", " << renderType << ", " << shareList << ", " << direct |
| 270 << ")"); |
| 271 GLXContext result = g_driver_glx.debug_fn.glXCreateNewContextFn( |
| 272 dpy, config, renderType, shareList, direct); |
| 273 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 274 return result; |
| 275 } |
| 276 |
| 277 static GLXPbuffer GL_BINDING_CALL |
| 278 Debug_glXCreatePbuffer(Display* dpy, |
| 279 GLXFBConfig config, |
| 280 const int* attribList) { |
| 281 GL_SERVICE_LOG("glXCreatePbuffer" |
| 282 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 283 << ", " << static_cast<const void*>(attribList) << ")"); |
| 284 GLXPbuffer result = |
| 285 g_driver_glx.debug_fn.glXCreatePbufferFn(dpy, config, attribList); |
| 286 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 287 return result; |
| 288 } |
| 289 |
| 290 static GLXPixmap GL_BINDING_CALL Debug_glXCreatePixmap(Display* dpy, |
| 291 GLXFBConfig config, |
| 292 Pixmap pixmap, |
| 293 const int* attribList) { |
| 294 GL_SERVICE_LOG("glXCreatePixmap" |
| 295 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 296 << ", " << pixmap << ", " |
| 297 << static_cast<const void*>(attribList) << ")"); |
| 298 GLXPixmap result = |
| 299 g_driver_glx.debug_fn.glXCreatePixmapFn(dpy, config, pixmap, attribList); |
| 300 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 301 return result; |
| 302 } |
| 303 |
| 304 static GLXWindow GL_BINDING_CALL Debug_glXCreateWindow(Display* dpy, |
| 305 GLXFBConfig config, |
| 306 Window win, |
| 307 const int* attribList) { |
| 308 GL_SERVICE_LOG("glXCreateWindow" |
| 309 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 310 << ", " << win << ", " << static_cast<const void*>(attribList) |
| 311 << ")"); |
| 312 GLXWindow result = |
| 313 g_driver_glx.debug_fn.glXCreateWindowFn(dpy, config, win, attribList); |
| 314 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 315 return result; |
| 316 } |
| 317 |
| 318 static void GL_BINDING_CALL |
| 319 Debug_glXDestroyContext(Display* dpy, GLXContext ctx) { |
| 320 GL_SERVICE_LOG("glXDestroyContext" |
| 321 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")"); |
| 322 g_driver_glx.debug_fn.glXDestroyContextFn(dpy, ctx); |
| 323 } |
| 324 |
| 325 static void GL_BINDING_CALL |
| 326 Debug_glXDestroyGLXPixmap(Display* dpy, GLXPixmap pixmap) { |
| 327 GL_SERVICE_LOG("glXDestroyGLXPixmap" |
| 328 << "(" << static_cast<const void*>(dpy) << ", " << pixmap |
| 329 << ")"); |
| 330 g_driver_glx.debug_fn.glXDestroyGLXPixmapFn(dpy, pixmap); |
| 331 } |
| 332 |
| 333 static void GL_BINDING_CALL |
| 334 Debug_glXDestroyPbuffer(Display* dpy, GLXPbuffer pbuf) { |
| 335 GL_SERVICE_LOG("glXDestroyPbuffer" |
| 336 << "(" << static_cast<const void*>(dpy) << ", " << pbuf |
| 337 << ")"); |
| 338 g_driver_glx.debug_fn.glXDestroyPbufferFn(dpy, pbuf); |
| 339 } |
| 340 |
| 341 static void GL_BINDING_CALL |
| 342 Debug_glXDestroyPixmap(Display* dpy, GLXPixmap pixmap) { |
| 343 GL_SERVICE_LOG("glXDestroyPixmap" |
| 344 << "(" << static_cast<const void*>(dpy) << ", " << pixmap |
| 345 << ")"); |
| 346 g_driver_glx.debug_fn.glXDestroyPixmapFn(dpy, pixmap); |
| 347 } |
| 348 |
| 349 static void GL_BINDING_CALL |
| 350 Debug_glXDestroyWindow(Display* dpy, GLXWindow window) { |
| 351 GL_SERVICE_LOG("glXDestroyWindow" |
| 352 << "(" << static_cast<const void*>(dpy) << ", " << window |
| 353 << ")"); |
| 354 g_driver_glx.debug_fn.glXDestroyWindowFn(dpy, window); |
| 355 } |
| 356 |
| 357 static const char* GL_BINDING_CALL |
| 358 Debug_glXGetClientString(Display* dpy, int name) { |
| 359 GL_SERVICE_LOG("glXGetClientString" |
| 360 << "(" << static_cast<const void*>(dpy) << ", " << name |
| 361 << ")"); |
| 362 const char* result = g_driver_glx.debug_fn.glXGetClientStringFn(dpy, name); |
| 363 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 364 return result; |
| 365 } |
| 366 |
| 367 static int GL_BINDING_CALL |
| 368 Debug_glXGetConfig(Display* dpy, XVisualInfo* visual, int attrib, int* value) { |
| 369 GL_SERVICE_LOG("glXGetConfig" |
| 370 << "(" << static_cast<const void*>(dpy) << ", " |
| 371 << static_cast<const void*>(visual) << ", " << attrib << ", " |
| 372 << static_cast<const void*>(value) << ")"); |
| 373 int result = g_driver_glx.debug_fn.glXGetConfigFn(dpy, visual, attrib, value); |
| 374 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 375 return result; |
| 376 } |
| 377 |
| 378 static GLXContext GL_BINDING_CALL Debug_glXGetCurrentContext(void) { |
| 379 GL_SERVICE_LOG("glXGetCurrentContext" |
| 380 << "(" |
| 381 << ")"); |
| 382 GLXContext result = g_driver_glx.debug_fn.glXGetCurrentContextFn(); |
| 383 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 384 return result; |
| 385 } |
| 386 |
| 387 static Display* GL_BINDING_CALL Debug_glXGetCurrentDisplay(void) { |
| 388 GL_SERVICE_LOG("glXGetCurrentDisplay" |
| 389 << "(" |
| 390 << ")"); |
| 391 Display* result = g_driver_glx.debug_fn.glXGetCurrentDisplayFn(); |
| 392 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 393 return result; |
| 394 } |
| 395 |
| 396 static GLXDrawable GL_BINDING_CALL Debug_glXGetCurrentDrawable(void) { |
| 397 GL_SERVICE_LOG("glXGetCurrentDrawable" |
| 398 << "(" |
| 399 << ")"); |
| 400 GLXDrawable result = g_driver_glx.debug_fn.glXGetCurrentDrawableFn(); |
| 401 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 402 return result; |
| 403 } |
| 404 |
| 405 static GLXDrawable GL_BINDING_CALL Debug_glXGetCurrentReadDrawable(void) { |
| 406 GL_SERVICE_LOG("glXGetCurrentReadDrawable" |
| 407 << "(" |
| 408 << ")"); |
| 409 GLXDrawable result = g_driver_glx.debug_fn.glXGetCurrentReadDrawableFn(); |
| 410 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 411 return result; |
| 412 } |
| 413 |
| 414 static int GL_BINDING_CALL Debug_glXGetFBConfigAttrib(Display* dpy, |
| 415 GLXFBConfig config, |
| 416 int attribute, |
| 417 int* value) { |
| 418 GL_SERVICE_LOG("glXGetFBConfigAttrib" |
| 419 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 420 << ", " << attribute << ", " << static_cast<const void*>(value) |
| 421 << ")"); |
| 422 int result = g_driver_glx.debug_fn.glXGetFBConfigAttribFn(dpy, config, |
| 423 attribute, value); |
| 424 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 425 return result; |
| 426 } |
| 427 |
| 428 static GLXFBConfig GL_BINDING_CALL |
| 429 Debug_glXGetFBConfigFromVisualSGIX(Display* dpy, XVisualInfo* visualInfo) { |
| 430 GL_SERVICE_LOG("glXGetFBConfigFromVisualSGIX" |
| 431 << "(" << static_cast<const void*>(dpy) << ", " |
| 432 << static_cast<const void*>(visualInfo) << ")"); |
| 433 GLXFBConfig result = |
| 434 g_driver_glx.debug_fn.glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo); |
| 435 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 436 return result; |
| 437 } |
| 438 |
| 439 static GLXFBConfig* GL_BINDING_CALL |
| 440 Debug_glXGetFBConfigs(Display* dpy, int screen, int* nelements) { |
| 441 GL_SERVICE_LOG("glXGetFBConfigs" |
| 442 << "(" << static_cast<const void*>(dpy) << ", " << screen |
| 443 << ", " << static_cast<const void*>(nelements) << ")"); |
| 444 GLXFBConfig* result = |
| 445 g_driver_glx.debug_fn.glXGetFBConfigsFn(dpy, screen, nelements); |
| 446 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 447 return result; |
| 448 } |
| 449 |
| 450 static bool GL_BINDING_CALL Debug_glXGetMscRateOML(Display* dpy, |
| 451 GLXDrawable drawable, |
| 452 int32* numerator, |
| 453 int32* denominator) { |
| 454 GL_SERVICE_LOG("glXGetMscRateOML" |
| 455 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 456 << ", " << static_cast<const void*>(numerator) << ", " |
| 457 << static_cast<const void*>(denominator) << ")"); |
| 458 bool result = g_driver_glx.debug_fn.glXGetMscRateOMLFn( |
| 459 dpy, drawable, numerator, denominator); |
| 460 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 461 return result; |
| 462 } |
| 463 |
| 464 static void GL_BINDING_CALL Debug_glXGetSelectedEvent(Display* dpy, |
| 465 GLXDrawable drawable, |
| 466 unsigned long* mask) { |
| 467 GL_SERVICE_LOG("glXGetSelectedEvent" |
| 468 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 469 << ", " << static_cast<const void*>(mask) << ")"); |
| 470 g_driver_glx.debug_fn.glXGetSelectedEventFn(dpy, drawable, mask); |
| 471 } |
| 472 |
| 473 static bool GL_BINDING_CALL Debug_glXGetSyncValuesOML(Display* dpy, |
| 474 GLXDrawable drawable, |
| 475 int64* ust, |
| 476 int64* msc, |
| 477 int64* sbc) { |
| 478 GL_SERVICE_LOG("glXGetSyncValuesOML" |
| 479 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 480 << ", " << static_cast<const void*>(ust) << ", " |
| 481 << static_cast<const void*>(msc) << ", " |
| 482 << static_cast<const void*>(sbc) << ")"); |
| 483 bool result = |
| 484 g_driver_glx.debug_fn.glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc); |
| 485 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 486 return result; |
| 487 } |
| 488 |
| 489 static XVisualInfo* GL_BINDING_CALL |
| 490 Debug_glXGetVisualFromFBConfig(Display* dpy, GLXFBConfig config) { |
| 491 GL_SERVICE_LOG("glXGetVisualFromFBConfig" |
| 492 << "(" << static_cast<const void*>(dpy) << ", " << config |
| 493 << ")"); |
| 494 XVisualInfo* result = |
| 495 g_driver_glx.debug_fn.glXGetVisualFromFBConfigFn(dpy, config); |
| 496 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 497 return result; |
| 498 } |
| 499 |
| 500 static int GL_BINDING_CALL Debug_glXIsDirect(Display* dpy, GLXContext ctx) { |
| 501 GL_SERVICE_LOG("glXIsDirect" |
| 502 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")"); |
| 503 int result = g_driver_glx.debug_fn.glXIsDirectFn(dpy, ctx); |
| 504 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 505 return result; |
| 506 } |
| 507 |
| 508 static int GL_BINDING_CALL Debug_glXMakeContextCurrent(Display* dpy, |
| 509 GLXDrawable draw, |
| 510 GLXDrawable read, |
| 511 GLXContext ctx) { |
| 512 GL_SERVICE_LOG("glXMakeContextCurrent" |
| 513 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", " |
| 514 << read << ", " << ctx << ")"); |
| 515 int result = |
| 516 g_driver_glx.debug_fn.glXMakeContextCurrentFn(dpy, draw, read, ctx); |
| 517 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 518 return result; |
| 519 } |
| 520 |
| 521 static int GL_BINDING_CALL |
| 522 Debug_glXMakeCurrent(Display* dpy, GLXDrawable drawable, GLXContext ctx) { |
| 523 GL_SERVICE_LOG("glXMakeCurrent" |
| 524 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 525 << ", " << ctx << ")"); |
| 526 int result = g_driver_glx.debug_fn.glXMakeCurrentFn(dpy, drawable, ctx); |
| 527 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 528 return result; |
| 529 } |
| 530 |
| 531 static int GL_BINDING_CALL |
| 532 Debug_glXQueryContext(Display* dpy, GLXContext ctx, int attribute, int* value) { |
| 533 GL_SERVICE_LOG("glXQueryContext" |
| 534 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ", " |
| 535 << attribute << ", " << static_cast<const void*>(value) |
| 536 << ")"); |
| 537 int result = |
| 538 g_driver_glx.debug_fn.glXQueryContextFn(dpy, ctx, attribute, value); |
| 539 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 540 return result; |
| 541 } |
| 542 |
| 543 static void GL_BINDING_CALL Debug_glXQueryDrawable(Display* dpy, |
| 544 GLXDrawable draw, |
| 545 int attribute, |
| 546 unsigned int* value) { |
| 547 GL_SERVICE_LOG("glXQueryDrawable" |
| 548 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", " |
| 549 << attribute << ", " << static_cast<const void*>(value) |
| 550 << ")"); |
| 551 g_driver_glx.debug_fn.glXQueryDrawableFn(dpy, draw, attribute, value); |
| 552 } |
| 553 |
| 554 static int GL_BINDING_CALL |
| 555 Debug_glXQueryExtension(Display* dpy, int* errorb, int* event) { |
| 556 GL_SERVICE_LOG("glXQueryExtension" |
| 557 << "(" << static_cast<const void*>(dpy) << ", " |
| 558 << static_cast<const void*>(errorb) << ", " |
| 559 << static_cast<const void*>(event) << ")"); |
| 560 int result = g_driver_glx.debug_fn.glXQueryExtensionFn(dpy, errorb, event); |
| 561 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 562 return result; |
| 563 } |
| 564 |
| 565 static const char* GL_BINDING_CALL |
| 566 Debug_glXQueryExtensionsString(Display* dpy, int screen) { |
| 567 GL_SERVICE_LOG("glXQueryExtensionsString" |
| 568 << "(" << static_cast<const void*>(dpy) << ", " << screen |
| 569 << ")"); |
| 570 const char* result = |
| 571 g_driver_glx.debug_fn.glXQueryExtensionsStringFn(dpy, screen); |
| 572 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 573 return result; |
| 574 } |
| 575 |
| 576 static const char* GL_BINDING_CALL |
| 577 Debug_glXQueryServerString(Display* dpy, int screen, int name) { |
| 578 GL_SERVICE_LOG("glXQueryServerString" |
| 579 << "(" << static_cast<const void*>(dpy) << ", " << screen |
| 580 << ", " << name << ")"); |
| 581 const char* result = |
| 582 g_driver_glx.debug_fn.glXQueryServerStringFn(dpy, screen, name); |
| 583 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 584 return result; |
| 585 } |
| 586 |
| 587 static int GL_BINDING_CALL |
| 588 Debug_glXQueryVersion(Display* dpy, int* maj, int* min) { |
| 589 GL_SERVICE_LOG("glXQueryVersion" |
| 590 << "(" << static_cast<const void*>(dpy) << ", " |
| 591 << static_cast<const void*>(maj) << ", " |
| 592 << static_cast<const void*>(min) << ")"); |
| 593 int result = g_driver_glx.debug_fn.glXQueryVersionFn(dpy, maj, min); |
| 594 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 595 return result; |
| 596 } |
| 597 |
| 598 static void GL_BINDING_CALL |
| 599 Debug_glXReleaseTexImageEXT(Display* dpy, GLXDrawable drawable, int buffer) { |
| 600 GL_SERVICE_LOG("glXReleaseTexImageEXT" |
| 601 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 602 << ", " << buffer << ")"); |
| 603 g_driver_glx.debug_fn.glXReleaseTexImageEXTFn(dpy, drawable, buffer); |
| 604 } |
| 605 |
| 606 static void GL_BINDING_CALL |
| 607 Debug_glXSelectEvent(Display* dpy, GLXDrawable drawable, unsigned long mask) { |
| 608 GL_SERVICE_LOG("glXSelectEvent" |
| 609 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 610 << ", " << mask << ")"); |
| 611 g_driver_glx.debug_fn.glXSelectEventFn(dpy, drawable, mask); |
| 612 } |
| 613 |
| 614 static void GL_BINDING_CALL |
| 615 Debug_glXSwapBuffers(Display* dpy, GLXDrawable drawable) { |
| 616 GL_SERVICE_LOG("glXSwapBuffers" |
| 617 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 618 << ")"); |
| 619 g_driver_glx.debug_fn.glXSwapBuffersFn(dpy, drawable); |
| 620 } |
| 621 |
| 622 static void GL_BINDING_CALL |
| 623 Debug_glXSwapIntervalEXT(Display* dpy, GLXDrawable drawable, int interval) { |
| 624 GL_SERVICE_LOG("glXSwapIntervalEXT" |
| 625 << "(" << static_cast<const void*>(dpy) << ", " << drawable |
| 626 << ", " << interval << ")"); |
| 627 g_driver_glx.debug_fn.glXSwapIntervalEXTFn(dpy, drawable, interval); |
| 628 } |
| 629 |
| 630 static void GL_BINDING_CALL Debug_glXSwapIntervalMESA(unsigned int interval) { |
| 631 GL_SERVICE_LOG("glXSwapIntervalMESA" |
| 632 << "(" << interval << ")"); |
| 633 g_driver_glx.debug_fn.glXSwapIntervalMESAFn(interval); |
| 634 } |
| 635 |
| 636 static void GL_BINDING_CALL |
| 637 Debug_glXUseXFont(Font font, int first, int count, int list) { |
| 638 GL_SERVICE_LOG("glXUseXFont" |
| 639 << "(" << font << ", " << first << ", " << count << ", " |
| 640 << list << ")"); |
| 641 g_driver_glx.debug_fn.glXUseXFontFn(font, first, count, list); |
| 642 } |
| 643 |
| 644 static void GL_BINDING_CALL Debug_glXWaitGL(void) { |
| 645 GL_SERVICE_LOG("glXWaitGL" |
| 646 << "(" |
| 647 << ")"); |
| 648 g_driver_glx.debug_fn.glXWaitGLFn(); |
| 649 } |
| 650 |
| 651 static int GL_BINDING_CALL |
| 652 Debug_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int* count) { |
| 653 GL_SERVICE_LOG("glXWaitVideoSyncSGI" |
| 654 << "(" << divisor << ", " << remainder << ", " |
| 655 << static_cast<const void*>(count) << ")"); |
| 656 int result = |
| 657 g_driver_glx.debug_fn.glXWaitVideoSyncSGIFn(divisor, remainder, count); |
| 658 GL_SERVICE_LOG("GL_RESULT: " << result); |
| 659 return result; |
| 660 } |
| 661 |
| 662 static void GL_BINDING_CALL Debug_glXWaitX(void) { |
| 663 GL_SERVICE_LOG("glXWaitX" |
| 664 << "(" |
| 665 << ")"); |
| 666 g_driver_glx.debug_fn.glXWaitXFn(); |
| 667 } |
| 668 } // extern "C" |
| 669 |
| 670 void DriverGLX::InitializeDebugBindings() { |
| 671 if (!debug_fn.glXBindTexImageEXTFn) { |
| 672 debug_fn.glXBindTexImageEXTFn = fn.glXBindTexImageEXTFn; |
| 673 fn.glXBindTexImageEXTFn = Debug_glXBindTexImageEXT; |
| 674 } |
| 675 if (!debug_fn.glXChooseFBConfigFn) { |
| 676 debug_fn.glXChooseFBConfigFn = fn.glXChooseFBConfigFn; |
| 677 fn.glXChooseFBConfigFn = Debug_glXChooseFBConfig; |
| 678 } |
| 679 if (!debug_fn.glXChooseVisualFn) { |
| 680 debug_fn.glXChooseVisualFn = fn.glXChooseVisualFn; |
| 681 fn.glXChooseVisualFn = Debug_glXChooseVisual; |
| 682 } |
| 683 if (!debug_fn.glXCopyContextFn) { |
| 684 debug_fn.glXCopyContextFn = fn.glXCopyContextFn; |
| 685 fn.glXCopyContextFn = Debug_glXCopyContext; |
| 686 } |
| 687 if (!debug_fn.glXCopySubBufferMESAFn) { |
| 688 debug_fn.glXCopySubBufferMESAFn = fn.glXCopySubBufferMESAFn; |
| 689 fn.glXCopySubBufferMESAFn = Debug_glXCopySubBufferMESA; |
| 690 } |
| 691 if (!debug_fn.glXCreateContextFn) { |
| 692 debug_fn.glXCreateContextFn = fn.glXCreateContextFn; |
| 693 fn.glXCreateContextFn = Debug_glXCreateContext; |
| 694 } |
| 695 if (!debug_fn.glXCreateContextAttribsARBFn) { |
| 696 debug_fn.glXCreateContextAttribsARBFn = fn.glXCreateContextAttribsARBFn; |
| 697 fn.glXCreateContextAttribsARBFn = Debug_glXCreateContextAttribsARB; |
| 698 } |
| 699 if (!debug_fn.glXCreateGLXPixmapFn) { |
| 700 debug_fn.glXCreateGLXPixmapFn = fn.glXCreateGLXPixmapFn; |
| 701 fn.glXCreateGLXPixmapFn = Debug_glXCreateGLXPixmap; |
| 702 } |
| 703 if (!debug_fn.glXCreateNewContextFn) { |
| 704 debug_fn.glXCreateNewContextFn = fn.glXCreateNewContextFn; |
| 705 fn.glXCreateNewContextFn = Debug_glXCreateNewContext; |
| 706 } |
| 707 if (!debug_fn.glXCreatePbufferFn) { |
| 708 debug_fn.glXCreatePbufferFn = fn.glXCreatePbufferFn; |
| 709 fn.glXCreatePbufferFn = Debug_glXCreatePbuffer; |
| 710 } |
| 711 if (!debug_fn.glXCreatePixmapFn) { |
| 712 debug_fn.glXCreatePixmapFn = fn.glXCreatePixmapFn; |
| 713 fn.glXCreatePixmapFn = Debug_glXCreatePixmap; |
| 714 } |
| 715 if (!debug_fn.glXCreateWindowFn) { |
| 716 debug_fn.glXCreateWindowFn = fn.glXCreateWindowFn; |
| 717 fn.glXCreateWindowFn = Debug_glXCreateWindow; |
| 718 } |
| 719 if (!debug_fn.glXDestroyContextFn) { |
| 720 debug_fn.glXDestroyContextFn = fn.glXDestroyContextFn; |
| 721 fn.glXDestroyContextFn = Debug_glXDestroyContext; |
| 722 } |
| 723 if (!debug_fn.glXDestroyGLXPixmapFn) { |
| 724 debug_fn.glXDestroyGLXPixmapFn = fn.glXDestroyGLXPixmapFn; |
| 725 fn.glXDestroyGLXPixmapFn = Debug_glXDestroyGLXPixmap; |
| 726 } |
| 727 if (!debug_fn.glXDestroyPbufferFn) { |
| 728 debug_fn.glXDestroyPbufferFn = fn.glXDestroyPbufferFn; |
| 729 fn.glXDestroyPbufferFn = Debug_glXDestroyPbuffer; |
| 730 } |
| 731 if (!debug_fn.glXDestroyPixmapFn) { |
| 732 debug_fn.glXDestroyPixmapFn = fn.glXDestroyPixmapFn; |
| 733 fn.glXDestroyPixmapFn = Debug_glXDestroyPixmap; |
| 734 } |
| 735 if (!debug_fn.glXDestroyWindowFn) { |
| 736 debug_fn.glXDestroyWindowFn = fn.glXDestroyWindowFn; |
| 737 fn.glXDestroyWindowFn = Debug_glXDestroyWindow; |
| 738 } |
| 739 if (!debug_fn.glXGetClientStringFn) { |
| 740 debug_fn.glXGetClientStringFn = fn.glXGetClientStringFn; |
| 741 fn.glXGetClientStringFn = Debug_glXGetClientString; |
| 742 } |
| 743 if (!debug_fn.glXGetConfigFn) { |
| 744 debug_fn.glXGetConfigFn = fn.glXGetConfigFn; |
| 745 fn.glXGetConfigFn = Debug_glXGetConfig; |
| 746 } |
| 747 if (!debug_fn.glXGetCurrentContextFn) { |
| 748 debug_fn.glXGetCurrentContextFn = fn.glXGetCurrentContextFn; |
| 749 fn.glXGetCurrentContextFn = Debug_glXGetCurrentContext; |
| 750 } |
| 751 if (!debug_fn.glXGetCurrentDisplayFn) { |
| 752 debug_fn.glXGetCurrentDisplayFn = fn.glXGetCurrentDisplayFn; |
| 753 fn.glXGetCurrentDisplayFn = Debug_glXGetCurrentDisplay; |
| 754 } |
| 755 if (!debug_fn.glXGetCurrentDrawableFn) { |
| 756 debug_fn.glXGetCurrentDrawableFn = fn.glXGetCurrentDrawableFn; |
| 757 fn.glXGetCurrentDrawableFn = Debug_glXGetCurrentDrawable; |
| 758 } |
| 759 if (!debug_fn.glXGetCurrentReadDrawableFn) { |
| 760 debug_fn.glXGetCurrentReadDrawableFn = fn.glXGetCurrentReadDrawableFn; |
| 761 fn.glXGetCurrentReadDrawableFn = Debug_glXGetCurrentReadDrawable; |
| 762 } |
| 763 if (!debug_fn.glXGetFBConfigAttribFn) { |
| 764 debug_fn.glXGetFBConfigAttribFn = fn.glXGetFBConfigAttribFn; |
| 765 fn.glXGetFBConfigAttribFn = Debug_glXGetFBConfigAttrib; |
| 766 } |
| 767 if (!debug_fn.glXGetFBConfigFromVisualSGIXFn) { |
| 768 debug_fn.glXGetFBConfigFromVisualSGIXFn = fn.glXGetFBConfigFromVisualSGIXFn; |
| 769 fn.glXGetFBConfigFromVisualSGIXFn = Debug_glXGetFBConfigFromVisualSGIX; |
| 770 } |
| 771 if (!debug_fn.glXGetFBConfigsFn) { |
| 772 debug_fn.glXGetFBConfigsFn = fn.glXGetFBConfigsFn; |
| 773 fn.glXGetFBConfigsFn = Debug_glXGetFBConfigs; |
| 774 } |
| 775 if (!debug_fn.glXGetMscRateOMLFn) { |
| 776 debug_fn.glXGetMscRateOMLFn = fn.glXGetMscRateOMLFn; |
| 777 fn.glXGetMscRateOMLFn = Debug_glXGetMscRateOML; |
| 778 } |
| 779 if (!debug_fn.glXGetSelectedEventFn) { |
| 780 debug_fn.glXGetSelectedEventFn = fn.glXGetSelectedEventFn; |
| 781 fn.glXGetSelectedEventFn = Debug_glXGetSelectedEvent; |
| 782 } |
| 783 if (!debug_fn.glXGetSyncValuesOMLFn) { |
| 784 debug_fn.glXGetSyncValuesOMLFn = fn.glXGetSyncValuesOMLFn; |
| 785 fn.glXGetSyncValuesOMLFn = Debug_glXGetSyncValuesOML; |
| 786 } |
| 787 if (!debug_fn.glXGetVisualFromFBConfigFn) { |
| 788 debug_fn.glXGetVisualFromFBConfigFn = fn.glXGetVisualFromFBConfigFn; |
| 789 fn.glXGetVisualFromFBConfigFn = Debug_glXGetVisualFromFBConfig; |
| 790 } |
| 791 if (!debug_fn.glXIsDirectFn) { |
| 792 debug_fn.glXIsDirectFn = fn.glXIsDirectFn; |
| 793 fn.glXIsDirectFn = Debug_glXIsDirect; |
| 794 } |
| 795 if (!debug_fn.glXMakeContextCurrentFn) { |
| 796 debug_fn.glXMakeContextCurrentFn = fn.glXMakeContextCurrentFn; |
| 797 fn.glXMakeContextCurrentFn = Debug_glXMakeContextCurrent; |
| 798 } |
| 799 if (!debug_fn.glXMakeCurrentFn) { |
| 800 debug_fn.glXMakeCurrentFn = fn.glXMakeCurrentFn; |
| 801 fn.glXMakeCurrentFn = Debug_glXMakeCurrent; |
| 802 } |
| 803 if (!debug_fn.glXQueryContextFn) { |
| 804 debug_fn.glXQueryContextFn = fn.glXQueryContextFn; |
| 805 fn.glXQueryContextFn = Debug_glXQueryContext; |
| 806 } |
| 807 if (!debug_fn.glXQueryDrawableFn) { |
| 808 debug_fn.glXQueryDrawableFn = fn.glXQueryDrawableFn; |
| 809 fn.glXQueryDrawableFn = Debug_glXQueryDrawable; |
| 810 } |
| 811 if (!debug_fn.glXQueryExtensionFn) { |
| 812 debug_fn.glXQueryExtensionFn = fn.glXQueryExtensionFn; |
| 813 fn.glXQueryExtensionFn = Debug_glXQueryExtension; |
| 814 } |
| 815 if (!debug_fn.glXQueryExtensionsStringFn) { |
| 816 debug_fn.glXQueryExtensionsStringFn = fn.glXQueryExtensionsStringFn; |
| 817 fn.glXQueryExtensionsStringFn = Debug_glXQueryExtensionsString; |
| 818 } |
| 819 if (!debug_fn.glXQueryServerStringFn) { |
| 820 debug_fn.glXQueryServerStringFn = fn.glXQueryServerStringFn; |
| 821 fn.glXQueryServerStringFn = Debug_glXQueryServerString; |
| 822 } |
| 823 if (!debug_fn.glXQueryVersionFn) { |
| 824 debug_fn.glXQueryVersionFn = fn.glXQueryVersionFn; |
| 825 fn.glXQueryVersionFn = Debug_glXQueryVersion; |
| 826 } |
| 827 if (!debug_fn.glXReleaseTexImageEXTFn) { |
| 828 debug_fn.glXReleaseTexImageEXTFn = fn.glXReleaseTexImageEXTFn; |
| 829 fn.glXReleaseTexImageEXTFn = Debug_glXReleaseTexImageEXT; |
| 830 } |
| 831 if (!debug_fn.glXSelectEventFn) { |
| 832 debug_fn.glXSelectEventFn = fn.glXSelectEventFn; |
| 833 fn.glXSelectEventFn = Debug_glXSelectEvent; |
| 834 } |
| 835 if (!debug_fn.glXSwapBuffersFn) { |
| 836 debug_fn.glXSwapBuffersFn = fn.glXSwapBuffersFn; |
| 837 fn.glXSwapBuffersFn = Debug_glXSwapBuffers; |
| 838 } |
| 839 if (!debug_fn.glXSwapIntervalEXTFn) { |
| 840 debug_fn.glXSwapIntervalEXTFn = fn.glXSwapIntervalEXTFn; |
| 841 fn.glXSwapIntervalEXTFn = Debug_glXSwapIntervalEXT; |
| 842 } |
| 843 if (!debug_fn.glXSwapIntervalMESAFn) { |
| 844 debug_fn.glXSwapIntervalMESAFn = fn.glXSwapIntervalMESAFn; |
| 845 fn.glXSwapIntervalMESAFn = Debug_glXSwapIntervalMESA; |
| 846 } |
| 847 if (!debug_fn.glXUseXFontFn) { |
| 848 debug_fn.glXUseXFontFn = fn.glXUseXFontFn; |
| 849 fn.glXUseXFontFn = Debug_glXUseXFont; |
| 850 } |
| 851 if (!debug_fn.glXWaitGLFn) { |
| 852 debug_fn.glXWaitGLFn = fn.glXWaitGLFn; |
| 853 fn.glXWaitGLFn = Debug_glXWaitGL; |
| 854 } |
| 855 if (!debug_fn.glXWaitVideoSyncSGIFn) { |
| 856 debug_fn.glXWaitVideoSyncSGIFn = fn.glXWaitVideoSyncSGIFn; |
| 857 fn.glXWaitVideoSyncSGIFn = Debug_glXWaitVideoSyncSGI; |
| 858 } |
| 859 if (!debug_fn.glXWaitXFn) { |
| 860 debug_fn.glXWaitXFn = fn.glXWaitXFn; |
| 861 fn.glXWaitXFn = Debug_glXWaitX; |
| 862 } |
| 863 g_debugBindingsInitialized = true; |
| 864 } |
| 865 |
| 866 void DriverGLX::ClearBindings() { |
| 867 memset(this, 0, sizeof(*this)); |
| 868 } |
| 869 |
| 870 void GLXApiBase::glXBindTexImageEXTFn(Display* dpy, |
| 871 GLXDrawable drawable, |
| 872 int buffer, |
| 873 int* attribList) { |
| 874 driver_->fn.glXBindTexImageEXTFn(dpy, drawable, buffer, attribList); |
| 875 } |
| 876 |
| 877 GLXFBConfig* GLXApiBase::glXChooseFBConfigFn(Display* dpy, |
| 878 int screen, |
| 879 const int* attribList, |
| 880 int* nitems) { |
| 881 return driver_->fn.glXChooseFBConfigFn(dpy, screen, attribList, nitems); |
| 882 } |
| 883 |
| 884 XVisualInfo* GLXApiBase::glXChooseVisualFn(Display* dpy, |
| 885 int screen, |
| 886 int* attribList) { |
| 887 return driver_->fn.glXChooseVisualFn(dpy, screen, attribList); |
| 888 } |
| 889 |
| 890 void GLXApiBase::glXCopyContextFn(Display* dpy, |
| 891 GLXContext src, |
| 892 GLXContext dst, |
| 893 unsigned long mask) { |
| 894 driver_->fn.glXCopyContextFn(dpy, src, dst, mask); |
| 895 } |
| 896 |
| 897 void GLXApiBase::glXCopySubBufferMESAFn(Display* dpy, |
| 898 GLXDrawable drawable, |
| 899 int x, |
| 900 int y, |
| 901 int width, |
| 902 int height) { |
| 903 driver_->fn.glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height); |
| 904 } |
| 905 |
| 906 GLXContext GLXApiBase::glXCreateContextFn(Display* dpy, |
| 907 XVisualInfo* vis, |
| 908 GLXContext shareList, |
| 909 int direct) { |
| 910 return driver_->fn.glXCreateContextFn(dpy, vis, shareList, direct); |
| 911 } |
| 912 |
| 913 GLXContext GLXApiBase::glXCreateContextAttribsARBFn(Display* dpy, |
| 914 GLXFBConfig config, |
| 915 GLXContext share_context, |
| 916 int direct, |
| 917 const int* attrib_list) { |
| 918 return driver_->fn.glXCreateContextAttribsARBFn(dpy, config, share_context, |
| 919 direct, attrib_list); |
| 920 } |
| 921 |
| 922 GLXPixmap GLXApiBase::glXCreateGLXPixmapFn(Display* dpy, |
| 923 XVisualInfo* visual, |
| 924 Pixmap pixmap) { |
| 925 return driver_->fn.glXCreateGLXPixmapFn(dpy, visual, pixmap); |
| 926 } |
| 927 |
| 928 GLXContext GLXApiBase::glXCreateNewContextFn(Display* dpy, |
| 929 GLXFBConfig config, |
| 930 int renderType, |
| 931 GLXContext shareList, |
| 932 int direct) { |
| 933 return driver_->fn.glXCreateNewContextFn(dpy, config, renderType, shareList, |
| 934 direct); |
| 935 } |
| 936 |
| 937 GLXPbuffer GLXApiBase::glXCreatePbufferFn(Display* dpy, |
| 938 GLXFBConfig config, |
| 939 const int* attribList) { |
| 940 return driver_->fn.glXCreatePbufferFn(dpy, config, attribList); |
| 941 } |
| 942 |
| 943 GLXPixmap GLXApiBase::glXCreatePixmapFn(Display* dpy, |
| 944 GLXFBConfig config, |
| 945 Pixmap pixmap, |
| 946 const int* attribList) { |
| 947 return driver_->fn.glXCreatePixmapFn(dpy, config, pixmap, attribList); |
| 948 } |
| 949 |
| 950 GLXWindow GLXApiBase::glXCreateWindowFn(Display* dpy, |
| 951 GLXFBConfig config, |
| 952 Window win, |
| 953 const int* attribList) { |
| 954 return driver_->fn.glXCreateWindowFn(dpy, config, win, attribList); |
| 955 } |
| 956 |
| 957 void GLXApiBase::glXDestroyContextFn(Display* dpy, GLXContext ctx) { |
| 958 driver_->fn.glXDestroyContextFn(dpy, ctx); |
| 959 } |
| 960 |
| 961 void GLXApiBase::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) { |
| 962 driver_->fn.glXDestroyGLXPixmapFn(dpy, pixmap); |
| 963 } |
| 964 |
| 965 void GLXApiBase::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) { |
| 966 driver_->fn.glXDestroyPbufferFn(dpy, pbuf); |
| 967 } |
| 968 |
| 969 void GLXApiBase::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) { |
| 970 driver_->fn.glXDestroyPixmapFn(dpy, pixmap); |
| 971 } |
| 972 |
| 973 void GLXApiBase::glXDestroyWindowFn(Display* dpy, GLXWindow window) { |
| 974 driver_->fn.glXDestroyWindowFn(dpy, window); |
| 975 } |
| 976 |
| 977 const char* GLXApiBase::glXGetClientStringFn(Display* dpy, int name) { |
| 978 return driver_->fn.glXGetClientStringFn(dpy, name); |
| 979 } |
| 980 |
| 981 int GLXApiBase::glXGetConfigFn(Display* dpy, |
| 982 XVisualInfo* visual, |
| 983 int attrib, |
| 984 int* value) { |
| 985 return driver_->fn.glXGetConfigFn(dpy, visual, attrib, value); |
| 986 } |
| 987 |
| 988 GLXContext GLXApiBase::glXGetCurrentContextFn(void) { |
| 989 return driver_->fn.glXGetCurrentContextFn(); |
| 990 } |
| 991 |
| 992 Display* GLXApiBase::glXGetCurrentDisplayFn(void) { |
| 993 return driver_->fn.glXGetCurrentDisplayFn(); |
| 994 } |
| 995 |
| 996 GLXDrawable GLXApiBase::glXGetCurrentDrawableFn(void) { |
| 997 return driver_->fn.glXGetCurrentDrawableFn(); |
| 998 } |
| 999 |
| 1000 GLXDrawable GLXApiBase::glXGetCurrentReadDrawableFn(void) { |
| 1001 return driver_->fn.glXGetCurrentReadDrawableFn(); |
| 1002 } |
| 1003 |
| 1004 int GLXApiBase::glXGetFBConfigAttribFn(Display* dpy, |
| 1005 GLXFBConfig config, |
| 1006 int attribute, |
| 1007 int* value) { |
| 1008 return driver_->fn.glXGetFBConfigAttribFn(dpy, config, attribute, value); |
| 1009 } |
| 1010 |
| 1011 GLXFBConfig GLXApiBase::glXGetFBConfigFromVisualSGIXFn( |
| 1012 Display* dpy, |
| 1013 XVisualInfo* visualInfo) { |
| 1014 return driver_->fn.glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo); |
| 1015 } |
| 1016 |
| 1017 GLXFBConfig* GLXApiBase::glXGetFBConfigsFn(Display* dpy, |
| 1018 int screen, |
| 1019 int* nelements) { |
| 1020 return driver_->fn.glXGetFBConfigsFn(dpy, screen, nelements); |
| 1021 } |
| 1022 |
| 1023 bool GLXApiBase::glXGetMscRateOMLFn(Display* dpy, |
| 1024 GLXDrawable drawable, |
| 1025 int32* numerator, |
| 1026 int32* denominator) { |
| 1027 return driver_->fn.glXGetMscRateOMLFn(dpy, drawable, numerator, denominator); |
| 1028 } |
| 1029 |
| 1030 void GLXApiBase::glXGetSelectedEventFn(Display* dpy, |
| 1031 GLXDrawable drawable, |
| 1032 unsigned long* mask) { |
| 1033 driver_->fn.glXGetSelectedEventFn(dpy, drawable, mask); |
| 1034 } |
| 1035 |
| 1036 bool GLXApiBase::glXGetSyncValuesOMLFn(Display* dpy, |
| 1037 GLXDrawable drawable, |
| 1038 int64* ust, |
| 1039 int64* msc, |
| 1040 int64* sbc) { |
| 1041 return driver_->fn.glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc); |
| 1042 } |
| 1043 |
| 1044 XVisualInfo* GLXApiBase::glXGetVisualFromFBConfigFn(Display* dpy, |
| 1045 GLXFBConfig config) { |
| 1046 return driver_->fn.glXGetVisualFromFBConfigFn(dpy, config); |
| 1047 } |
| 1048 |
| 1049 int GLXApiBase::glXIsDirectFn(Display* dpy, GLXContext ctx) { |
| 1050 return driver_->fn.glXIsDirectFn(dpy, ctx); |
| 1051 } |
| 1052 |
| 1053 int GLXApiBase::glXMakeContextCurrentFn(Display* dpy, |
| 1054 GLXDrawable draw, |
| 1055 GLXDrawable read, |
| 1056 GLXContext ctx) { |
| 1057 return driver_->fn.glXMakeContextCurrentFn(dpy, draw, read, ctx); |
| 1058 } |
| 1059 |
| 1060 int GLXApiBase::glXMakeCurrentFn(Display* dpy, |
| 1061 GLXDrawable drawable, |
| 1062 GLXContext ctx) { |
| 1063 return driver_->fn.glXMakeCurrentFn(dpy, drawable, ctx); |
| 1064 } |
| 1065 |
| 1066 int GLXApiBase::glXQueryContextFn(Display* dpy, |
| 1067 GLXContext ctx, |
| 1068 int attribute, |
| 1069 int* value) { |
| 1070 return driver_->fn.glXQueryContextFn(dpy, ctx, attribute, value); |
| 1071 } |
| 1072 |
| 1073 void GLXApiBase::glXQueryDrawableFn(Display* dpy, |
| 1074 GLXDrawable draw, |
| 1075 int attribute, |
| 1076 unsigned int* value) { |
| 1077 driver_->fn.glXQueryDrawableFn(dpy, draw, attribute, value); |
| 1078 } |
| 1079 |
| 1080 int GLXApiBase::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) { |
| 1081 return driver_->fn.glXQueryExtensionFn(dpy, errorb, event); |
| 1082 } |
| 1083 |
| 1084 const char* GLXApiBase::glXQueryExtensionsStringFn(Display* dpy, int screen) { |
| 1085 return driver_->fn.glXQueryExtensionsStringFn(dpy, screen); |
| 1086 } |
| 1087 |
| 1088 const char* GLXApiBase::glXQueryServerStringFn(Display* dpy, |
| 1089 int screen, |
| 1090 int name) { |
| 1091 return driver_->fn.glXQueryServerStringFn(dpy, screen, name); |
| 1092 } |
| 1093 |
| 1094 int GLXApiBase::glXQueryVersionFn(Display* dpy, int* maj, int* min) { |
| 1095 return driver_->fn.glXQueryVersionFn(dpy, maj, min); |
| 1096 } |
| 1097 |
| 1098 void GLXApiBase::glXReleaseTexImageEXTFn(Display* dpy, |
| 1099 GLXDrawable drawable, |
| 1100 int buffer) { |
| 1101 driver_->fn.glXReleaseTexImageEXTFn(dpy, drawable, buffer); |
| 1102 } |
| 1103 |
| 1104 void GLXApiBase::glXSelectEventFn(Display* dpy, |
| 1105 GLXDrawable drawable, |
| 1106 unsigned long mask) { |
| 1107 driver_->fn.glXSelectEventFn(dpy, drawable, mask); |
| 1108 } |
| 1109 |
| 1110 void GLXApiBase::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) { |
| 1111 driver_->fn.glXSwapBuffersFn(dpy, drawable); |
| 1112 } |
| 1113 |
| 1114 void GLXApiBase::glXSwapIntervalEXTFn(Display* dpy, |
| 1115 GLXDrawable drawable, |
| 1116 int interval) { |
| 1117 driver_->fn.glXSwapIntervalEXTFn(dpy, drawable, interval); |
| 1118 } |
| 1119 |
| 1120 void GLXApiBase::glXSwapIntervalMESAFn(unsigned int interval) { |
| 1121 driver_->fn.glXSwapIntervalMESAFn(interval); |
| 1122 } |
| 1123 |
| 1124 void GLXApiBase::glXUseXFontFn(Font font, int first, int count, int list) { |
| 1125 driver_->fn.glXUseXFontFn(font, first, count, list); |
| 1126 } |
| 1127 |
| 1128 void GLXApiBase::glXWaitGLFn(void) { |
| 1129 driver_->fn.glXWaitGLFn(); |
| 1130 } |
| 1131 |
| 1132 int GLXApiBase::glXWaitVideoSyncSGIFn(int divisor, |
| 1133 int remainder, |
| 1134 unsigned int* count) { |
| 1135 return driver_->fn.glXWaitVideoSyncSGIFn(divisor, remainder, count); |
| 1136 } |
| 1137 |
| 1138 void GLXApiBase::glXWaitXFn(void) { |
| 1139 driver_->fn.glXWaitXFn(); |
| 1140 } |
| 1141 |
| 1142 void TraceGLXApi::glXBindTexImageEXTFn(Display* dpy, |
| 1143 GLXDrawable drawable, |
| 1144 int buffer, |
| 1145 int* attribList) { |
| 1146 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXBindTexImageEXT") |
| 1147 glx_api_->glXBindTexImageEXTFn(dpy, drawable, buffer, attribList); |
| 1148 } |
| 1149 |
| 1150 GLXFBConfig* TraceGLXApi::glXChooseFBConfigFn(Display* dpy, |
| 1151 int screen, |
| 1152 const int* attribList, |
| 1153 int* nitems) { |
| 1154 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXChooseFBConfig") |
| 1155 return glx_api_->glXChooseFBConfigFn(dpy, screen, attribList, nitems); |
| 1156 } |
| 1157 |
| 1158 XVisualInfo* TraceGLXApi::glXChooseVisualFn(Display* dpy, |
| 1159 int screen, |
| 1160 int* attribList) { |
| 1161 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXChooseVisual") |
| 1162 return glx_api_->glXChooseVisualFn(dpy, screen, attribList); |
| 1163 } |
| 1164 |
| 1165 void TraceGLXApi::glXCopyContextFn(Display* dpy, |
| 1166 GLXContext src, |
| 1167 GLXContext dst, |
| 1168 unsigned long mask) { |
| 1169 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCopyContext") |
| 1170 glx_api_->glXCopyContextFn(dpy, src, dst, mask); |
| 1171 } |
| 1172 |
| 1173 void TraceGLXApi::glXCopySubBufferMESAFn(Display* dpy, |
| 1174 GLXDrawable drawable, |
| 1175 int x, |
| 1176 int y, |
| 1177 int width, |
| 1178 int height) { |
| 1179 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCopySubBufferMESA") |
| 1180 glx_api_->glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height); |
| 1181 } |
| 1182 |
| 1183 GLXContext TraceGLXApi::glXCreateContextFn(Display* dpy, |
| 1184 XVisualInfo* vis, |
| 1185 GLXContext shareList, |
| 1186 int direct) { |
| 1187 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateContext") |
| 1188 return glx_api_->glXCreateContextFn(dpy, vis, shareList, direct); |
| 1189 } |
| 1190 |
| 1191 GLXContext TraceGLXApi::glXCreateContextAttribsARBFn(Display* dpy, |
| 1192 GLXFBConfig config, |
| 1193 GLXContext share_context, |
| 1194 int direct, |
| 1195 const int* attrib_list) { |
| 1196 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateContextAttribsARB") |
| 1197 return glx_api_->glXCreateContextAttribsARBFn(dpy, config, share_context, |
| 1198 direct, attrib_list); |
| 1199 } |
| 1200 |
| 1201 GLXPixmap TraceGLXApi::glXCreateGLXPixmapFn(Display* dpy, |
| 1202 XVisualInfo* visual, |
| 1203 Pixmap pixmap) { |
| 1204 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateGLXPixmap") |
| 1205 return glx_api_->glXCreateGLXPixmapFn(dpy, visual, pixmap); |
| 1206 } |
| 1207 |
| 1208 GLXContext TraceGLXApi::glXCreateNewContextFn(Display* dpy, |
| 1209 GLXFBConfig config, |
| 1210 int renderType, |
| 1211 GLXContext shareList, |
| 1212 int direct) { |
| 1213 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateNewContext") |
| 1214 return glx_api_->glXCreateNewContextFn(dpy, config, renderType, shareList, |
| 1215 direct); |
| 1216 } |
| 1217 |
| 1218 GLXPbuffer TraceGLXApi::glXCreatePbufferFn(Display* dpy, |
| 1219 GLXFBConfig config, |
| 1220 const int* attribList) { |
| 1221 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreatePbuffer") |
| 1222 return glx_api_->glXCreatePbufferFn(dpy, config, attribList); |
| 1223 } |
| 1224 |
| 1225 GLXPixmap TraceGLXApi::glXCreatePixmapFn(Display* dpy, |
| 1226 GLXFBConfig config, |
| 1227 Pixmap pixmap, |
| 1228 const int* attribList) { |
| 1229 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreatePixmap") |
| 1230 return glx_api_->glXCreatePixmapFn(dpy, config, pixmap, attribList); |
| 1231 } |
| 1232 |
| 1233 GLXWindow TraceGLXApi::glXCreateWindowFn(Display* dpy, |
| 1234 GLXFBConfig config, |
| 1235 Window win, |
| 1236 const int* attribList) { |
| 1237 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateWindow") |
| 1238 return glx_api_->glXCreateWindowFn(dpy, config, win, attribList); |
| 1239 } |
| 1240 |
| 1241 void TraceGLXApi::glXDestroyContextFn(Display* dpy, GLXContext ctx) { |
| 1242 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyContext") |
| 1243 glx_api_->glXDestroyContextFn(dpy, ctx); |
| 1244 } |
| 1245 |
| 1246 void TraceGLXApi::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) { |
| 1247 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyGLXPixmap") |
| 1248 glx_api_->glXDestroyGLXPixmapFn(dpy, pixmap); |
| 1249 } |
| 1250 |
| 1251 void TraceGLXApi::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) { |
| 1252 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyPbuffer") |
| 1253 glx_api_->glXDestroyPbufferFn(dpy, pbuf); |
| 1254 } |
| 1255 |
| 1256 void TraceGLXApi::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) { |
| 1257 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyPixmap") |
| 1258 glx_api_->glXDestroyPixmapFn(dpy, pixmap); |
| 1259 } |
| 1260 |
| 1261 void TraceGLXApi::glXDestroyWindowFn(Display* dpy, GLXWindow window) { |
| 1262 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyWindow") |
| 1263 glx_api_->glXDestroyWindowFn(dpy, window); |
| 1264 } |
| 1265 |
| 1266 const char* TraceGLXApi::glXGetClientStringFn(Display* dpy, int name) { |
| 1267 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetClientString") |
| 1268 return glx_api_->glXGetClientStringFn(dpy, name); |
| 1269 } |
| 1270 |
| 1271 int TraceGLXApi::glXGetConfigFn(Display* dpy, |
| 1272 XVisualInfo* visual, |
| 1273 int attrib, |
| 1274 int* value) { |
| 1275 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetConfig") |
| 1276 return glx_api_->glXGetConfigFn(dpy, visual, attrib, value); |
| 1277 } |
| 1278 |
| 1279 GLXContext TraceGLXApi::glXGetCurrentContextFn(void) { |
| 1280 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentContext") |
| 1281 return glx_api_->glXGetCurrentContextFn(); |
| 1282 } |
| 1283 |
| 1284 Display* TraceGLXApi::glXGetCurrentDisplayFn(void) { |
| 1285 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentDisplay") |
| 1286 return glx_api_->glXGetCurrentDisplayFn(); |
| 1287 } |
| 1288 |
| 1289 GLXDrawable TraceGLXApi::glXGetCurrentDrawableFn(void) { |
| 1290 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentDrawable") |
| 1291 return glx_api_->glXGetCurrentDrawableFn(); |
| 1292 } |
| 1293 |
| 1294 GLXDrawable TraceGLXApi::glXGetCurrentReadDrawableFn(void) { |
| 1295 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentReadDrawable") |
| 1296 return glx_api_->glXGetCurrentReadDrawableFn(); |
| 1297 } |
| 1298 |
| 1299 int TraceGLXApi::glXGetFBConfigAttribFn(Display* dpy, |
| 1300 GLXFBConfig config, |
| 1301 int attribute, |
| 1302 int* value) { |
| 1303 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetFBConfigAttrib") |
| 1304 return glx_api_->glXGetFBConfigAttribFn(dpy, config, attribute, value); |
| 1305 } |
| 1306 |
| 1307 GLXFBConfig TraceGLXApi::glXGetFBConfigFromVisualSGIXFn( |
| 1308 Display* dpy, |
| 1309 XVisualInfo* visualInfo) { |
| 1310 TRACE_EVENT_BINARY_EFFICIENT0("gpu", |
| 1311 "TraceGLAPI::glXGetFBConfigFromVisualSGIX") |
| 1312 return glx_api_->glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo); |
| 1313 } |
| 1314 |
| 1315 GLXFBConfig* TraceGLXApi::glXGetFBConfigsFn(Display* dpy, |
| 1316 int screen, |
| 1317 int* nelements) { |
| 1318 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetFBConfigs") |
| 1319 return glx_api_->glXGetFBConfigsFn(dpy, screen, nelements); |
| 1320 } |
| 1321 |
| 1322 bool TraceGLXApi::glXGetMscRateOMLFn(Display* dpy, |
| 1323 GLXDrawable drawable, |
| 1324 int32* numerator, |
| 1325 int32* denominator) { |
| 1326 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetMscRateOML") |
| 1327 return glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator); |
| 1328 } |
| 1329 |
| 1330 void TraceGLXApi::glXGetSelectedEventFn(Display* dpy, |
| 1331 GLXDrawable drawable, |
| 1332 unsigned long* mask) { |
| 1333 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetSelectedEvent") |
| 1334 glx_api_->glXGetSelectedEventFn(dpy, drawable, mask); |
| 1335 } |
| 1336 |
| 1337 bool TraceGLXApi::glXGetSyncValuesOMLFn(Display* dpy, |
| 1338 GLXDrawable drawable, |
| 1339 int64* ust, |
| 1340 int64* msc, |
| 1341 int64* sbc) { |
| 1342 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetSyncValuesOML") |
| 1343 return glx_api_->glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc); |
| 1344 } |
| 1345 |
| 1346 XVisualInfo* TraceGLXApi::glXGetVisualFromFBConfigFn(Display* dpy, |
| 1347 GLXFBConfig config) { |
| 1348 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetVisualFromFBConfig") |
| 1349 return glx_api_->glXGetVisualFromFBConfigFn(dpy, config); |
| 1350 } |
| 1351 |
| 1352 int TraceGLXApi::glXIsDirectFn(Display* dpy, GLXContext ctx) { |
| 1353 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXIsDirect") |
| 1354 return glx_api_->glXIsDirectFn(dpy, ctx); |
| 1355 } |
| 1356 |
| 1357 int TraceGLXApi::glXMakeContextCurrentFn(Display* dpy, |
| 1358 GLXDrawable draw, |
| 1359 GLXDrawable read, |
| 1360 GLXContext ctx) { |
| 1361 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXMakeContextCurrent") |
| 1362 return glx_api_->glXMakeContextCurrentFn(dpy, draw, read, ctx); |
| 1363 } |
| 1364 |
| 1365 int TraceGLXApi::glXMakeCurrentFn(Display* dpy, |
| 1366 GLXDrawable drawable, |
| 1367 GLXContext ctx) { |
| 1368 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXMakeCurrent") |
| 1369 return glx_api_->glXMakeCurrentFn(dpy, drawable, ctx); |
| 1370 } |
| 1371 |
| 1372 int TraceGLXApi::glXQueryContextFn(Display* dpy, |
| 1373 GLXContext ctx, |
| 1374 int attribute, |
| 1375 int* value) { |
| 1376 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryContext") |
| 1377 return glx_api_->glXQueryContextFn(dpy, ctx, attribute, value); |
| 1378 } |
| 1379 |
| 1380 void TraceGLXApi::glXQueryDrawableFn(Display* dpy, |
| 1381 GLXDrawable draw, |
| 1382 int attribute, |
| 1383 unsigned int* value) { |
| 1384 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryDrawable") |
| 1385 glx_api_->glXQueryDrawableFn(dpy, draw, attribute, value); |
| 1386 } |
| 1387 |
| 1388 int TraceGLXApi::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) { |
| 1389 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryExtension") |
| 1390 return glx_api_->glXQueryExtensionFn(dpy, errorb, event); |
| 1391 } |
| 1392 |
| 1393 const char* TraceGLXApi::glXQueryExtensionsStringFn(Display* dpy, int screen) { |
| 1394 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryExtensionsString") |
| 1395 return glx_api_->glXQueryExtensionsStringFn(dpy, screen); |
| 1396 } |
| 1397 |
| 1398 const char* TraceGLXApi::glXQueryServerStringFn(Display* dpy, |
| 1399 int screen, |
| 1400 int name) { |
| 1401 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryServerString") |
| 1402 return glx_api_->glXQueryServerStringFn(dpy, screen, name); |
| 1403 } |
| 1404 |
| 1405 int TraceGLXApi::glXQueryVersionFn(Display* dpy, int* maj, int* min) { |
| 1406 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryVersion") |
| 1407 return glx_api_->glXQueryVersionFn(dpy, maj, min); |
| 1408 } |
| 1409 |
| 1410 void TraceGLXApi::glXReleaseTexImageEXTFn(Display* dpy, |
| 1411 GLXDrawable drawable, |
| 1412 int buffer) { |
| 1413 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXReleaseTexImageEXT") |
| 1414 glx_api_->glXReleaseTexImageEXTFn(dpy, drawable, buffer); |
| 1415 } |
| 1416 |
| 1417 void TraceGLXApi::glXSelectEventFn(Display* dpy, |
| 1418 GLXDrawable drawable, |
| 1419 unsigned long mask) { |
| 1420 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSelectEvent") |
| 1421 glx_api_->glXSelectEventFn(dpy, drawable, mask); |
| 1422 } |
| 1423 |
| 1424 void TraceGLXApi::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) { |
| 1425 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapBuffers") |
| 1426 glx_api_->glXSwapBuffersFn(dpy, drawable); |
| 1427 } |
| 1428 |
| 1429 void TraceGLXApi::glXSwapIntervalEXTFn(Display* dpy, |
| 1430 GLXDrawable drawable, |
| 1431 int interval) { |
| 1432 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapIntervalEXT") |
| 1433 glx_api_->glXSwapIntervalEXTFn(dpy, drawable, interval); |
| 1434 } |
| 1435 |
| 1436 void TraceGLXApi::glXSwapIntervalMESAFn(unsigned int interval) { |
| 1437 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapIntervalMESA") |
| 1438 glx_api_->glXSwapIntervalMESAFn(interval); |
| 1439 } |
| 1440 |
| 1441 void TraceGLXApi::glXUseXFontFn(Font font, int first, int count, int list) { |
| 1442 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXUseXFont") |
| 1443 glx_api_->glXUseXFontFn(font, first, count, list); |
| 1444 } |
| 1445 |
| 1446 void TraceGLXApi::glXWaitGLFn(void) { |
| 1447 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitGL") |
| 1448 glx_api_->glXWaitGLFn(); |
| 1449 } |
| 1450 |
| 1451 int TraceGLXApi::glXWaitVideoSyncSGIFn(int divisor, |
| 1452 int remainder, |
| 1453 unsigned int* count) { |
| 1454 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI") |
| 1455 return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count); |
| 1456 } |
| 1457 |
| 1458 void TraceGLXApi::glXWaitXFn(void) { |
| 1459 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX") |
| 1460 glx_api_->glXWaitXFn(); |
| 1461 } |
| 1462 |
| 1463 } // namespace gfx |
OLD | NEW |