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