| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // ui/gl/generate_bindings.py | 6 // ui/gl/generate_bindings.py |
| 7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
| 14 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
| 15 #include "ui/gl/gl_context.h" | 15 #include "ui/gl/gl_context.h" |
| 16 #include "ui/gl/gl_enums.h" | 16 #include "ui/gl/gl_enums.h" |
| 17 #include "ui/gl/gl_glx_api_implementation.h" | 17 #include "ui/gl/gl_glx_api_implementation.h" |
| 18 #include "ui/gl/gl_implementation.h" | 18 #include "ui/gl/gl_implementation.h" |
| 19 #include "ui/gl/gl_version_info.h" | 19 #include "ui/gl/gl_version_info.h" |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 | 22 |
| 23 static bool g_debugBindingsInitialized; | 23 static bool g_debugBindingsInitialized; |
| 24 DriverGLX g_driver_glx; | 24 DriverGLX g_driver_glx; |
| 25 | 25 |
| 26 void glXBindTexImageEXTNotBound(Display* dpy, |
| 27 GLXDrawable drawable, |
| 28 int buffer, |
| 29 int* attribList) { |
| 30 NOTREACHED(); |
| 31 } |
| 32 void glXCopySubBufferMESANotBound(Display* dpy, |
| 33 GLXDrawable drawable, |
| 34 int x, |
| 35 int y, |
| 36 int width, |
| 37 int height) { |
| 38 NOTREACHED(); |
| 39 } |
| 40 GLXContext glXCreateContextAttribsARBNotBound(Display* dpy, |
| 41 GLXFBConfig config, |
| 42 GLXContext share_context, |
| 43 int direct, |
| 44 const int* attrib_list) { |
| 45 NOTREACHED(); |
| 46 return 0; |
| 47 } |
| 48 GLXFBConfig glXGetFBConfigFromVisualSGIXNotBound(Display* dpy, |
| 49 XVisualInfo* visualInfo) { |
| 50 NOTREACHED(); |
| 51 return 0; |
| 52 } |
| 53 bool glXGetMscRateOMLNotBound(Display* dpy, |
| 54 GLXDrawable drawable, |
| 55 int32* numerator, |
| 56 int32* denominator) { |
| 57 NOTREACHED(); |
| 58 return 0; |
| 59 } |
| 60 bool glXGetSyncValuesOMLNotBound(Display* dpy, |
| 61 GLXDrawable drawable, |
| 62 int64* ust, |
| 63 int64* msc, |
| 64 int64* sbc) { |
| 65 NOTREACHED(); |
| 66 return 0; |
| 67 } |
| 68 void glXReleaseTexImageEXTNotBound(Display* dpy, |
| 69 GLXDrawable drawable, |
| 70 int buffer) { |
| 71 NOTREACHED(); |
| 72 } |
| 73 void glXSwapIntervalEXTNotBound(Display* dpy, |
| 74 GLXDrawable drawable, |
| 75 int interval) { |
| 76 NOTREACHED(); |
| 77 } |
| 78 void glXSwapIntervalMESANotBound(unsigned int interval) { |
| 79 NOTREACHED(); |
| 80 } |
| 81 int glXWaitVideoSyncSGINotBound(int divisor, |
| 82 int remainder, |
| 83 unsigned int* count) { |
| 84 NOTREACHED(); |
| 85 return 0; |
| 86 } |
| 87 |
| 26 void DriverGLX::InitializeStaticBindings() { | 88 void DriverGLX::InitializeStaticBindings() { |
| 27 fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>( | 89 fn.glXBindTexImageEXTFn = |
| 28 GetGLProcAddress("glXBindTexImageEXT")); | 90 reinterpret_cast<glXBindTexImageEXTProc>(glXBindTexImageEXTNotBound); |
| 29 fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>( | 91 fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>( |
| 30 GetGLProcAddress("glXChooseFBConfig")); | 92 GetGLProcAddress("glXChooseFBConfig")); |
| 31 fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>( | 93 fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>( |
| 32 GetGLProcAddress("glXChooseVisual")); | 94 GetGLProcAddress("glXChooseVisual")); |
| 33 fn.glXCopyContextFn = | 95 fn.glXCopyContextFn = |
| 34 reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext")); | 96 reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext")); |
| 35 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>( | 97 fn.glXCopySubBufferMESAFn = |
| 36 GetGLProcAddress("glXCopySubBufferMESA")); | 98 reinterpret_cast<glXCopySubBufferMESAProc>(glXCopySubBufferMESANotBound); |
| 37 fn.glXCreateContextFn = reinterpret_cast<glXCreateContextProc>( | 99 fn.glXCreateContextFn = reinterpret_cast<glXCreateContextProc>( |
| 38 GetGLProcAddress("glXCreateContext")); | 100 GetGLProcAddress("glXCreateContext")); |
| 39 fn.glXCreateContextAttribsARBFn = | 101 fn.glXCreateContextAttribsARBFn = |
| 40 reinterpret_cast<glXCreateContextAttribsARBProc>( | 102 reinterpret_cast<glXCreateContextAttribsARBProc>( |
| 41 GetGLProcAddress("glXCreateContextAttribsARB")); | 103 glXCreateContextAttribsARBNotBound); |
| 42 fn.glXCreateGLXPixmapFn = reinterpret_cast<glXCreateGLXPixmapProc>( | 104 fn.glXCreateGLXPixmapFn = reinterpret_cast<glXCreateGLXPixmapProc>( |
| 43 GetGLProcAddress("glXCreateGLXPixmap")); | 105 GetGLProcAddress("glXCreateGLXPixmap")); |
| 44 fn.glXCreateNewContextFn = reinterpret_cast<glXCreateNewContextProc>( | 106 fn.glXCreateNewContextFn = reinterpret_cast<glXCreateNewContextProc>( |
| 45 GetGLProcAddress("glXCreateNewContext")); | 107 GetGLProcAddress("glXCreateNewContext")); |
| 46 fn.glXCreatePbufferFn = reinterpret_cast<glXCreatePbufferProc>( | 108 fn.glXCreatePbufferFn = reinterpret_cast<glXCreatePbufferProc>( |
| 47 GetGLProcAddress("glXCreatePbuffer")); | 109 GetGLProcAddress("glXCreatePbuffer")); |
| 48 fn.glXCreatePixmapFn = reinterpret_cast<glXCreatePixmapProc>( | 110 fn.glXCreatePixmapFn = reinterpret_cast<glXCreatePixmapProc>( |
| 49 GetGLProcAddress("glXCreatePixmap")); | 111 GetGLProcAddress("glXCreatePixmap")); |
| 50 fn.glXCreateWindowFn = reinterpret_cast<glXCreateWindowProc>( | 112 fn.glXCreateWindowFn = reinterpret_cast<glXCreateWindowProc>( |
| 51 GetGLProcAddress("glXCreateWindow")); | 113 GetGLProcAddress("glXCreateWindow")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 GetGLProcAddress("glXGetCurrentDisplay")); | 131 GetGLProcAddress("glXGetCurrentDisplay")); |
| 70 fn.glXGetCurrentDrawableFn = reinterpret_cast<glXGetCurrentDrawableProc>( | 132 fn.glXGetCurrentDrawableFn = reinterpret_cast<glXGetCurrentDrawableProc>( |
| 71 GetGLProcAddress("glXGetCurrentDrawable")); | 133 GetGLProcAddress("glXGetCurrentDrawable")); |
| 72 fn.glXGetCurrentReadDrawableFn = | 134 fn.glXGetCurrentReadDrawableFn = |
| 73 reinterpret_cast<glXGetCurrentReadDrawableProc>( | 135 reinterpret_cast<glXGetCurrentReadDrawableProc>( |
| 74 GetGLProcAddress("glXGetCurrentReadDrawable")); | 136 GetGLProcAddress("glXGetCurrentReadDrawable")); |
| 75 fn.glXGetFBConfigAttribFn = reinterpret_cast<glXGetFBConfigAttribProc>( | 137 fn.glXGetFBConfigAttribFn = reinterpret_cast<glXGetFBConfigAttribProc>( |
| 76 GetGLProcAddress("glXGetFBConfigAttrib")); | 138 GetGLProcAddress("glXGetFBConfigAttrib")); |
| 77 fn.glXGetFBConfigFromVisualSGIXFn = | 139 fn.glXGetFBConfigFromVisualSGIXFn = |
| 78 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( | 140 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( |
| 79 GetGLProcAddress("glXGetFBConfigFromVisualSGIX")); | 141 glXGetFBConfigFromVisualSGIXNotBound); |
| 80 fn.glXGetFBConfigsFn = reinterpret_cast<glXGetFBConfigsProc>( | 142 fn.glXGetFBConfigsFn = reinterpret_cast<glXGetFBConfigsProc>( |
| 81 GetGLProcAddress("glXGetFBConfigs")); | 143 GetGLProcAddress("glXGetFBConfigs")); |
| 82 fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>( | 144 fn.glXGetMscRateOMLFn = |
| 83 GetGLProcAddress("glXGetMscRateOML")); | 145 reinterpret_cast<glXGetMscRateOMLProc>(glXGetMscRateOMLNotBound); |
| 84 fn.glXGetSelectedEventFn = reinterpret_cast<glXGetSelectedEventProc>( | 146 fn.glXGetSelectedEventFn = reinterpret_cast<glXGetSelectedEventProc>( |
| 85 GetGLProcAddress("glXGetSelectedEvent")); | 147 GetGLProcAddress("glXGetSelectedEvent")); |
| 86 fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>( | 148 fn.glXGetSyncValuesOMLFn = |
| 87 GetGLProcAddress("glXGetSyncValuesOML")); | 149 reinterpret_cast<glXGetSyncValuesOMLProc>(glXGetSyncValuesOMLNotBound); |
| 88 fn.glXGetVisualFromFBConfigFn = | 150 fn.glXGetVisualFromFBConfigFn = |
| 89 reinterpret_cast<glXGetVisualFromFBConfigProc>( | 151 reinterpret_cast<glXGetVisualFromFBConfigProc>( |
| 90 GetGLProcAddress("glXGetVisualFromFBConfig")); | 152 GetGLProcAddress("glXGetVisualFromFBConfig")); |
| 91 fn.glXIsDirectFn = | 153 fn.glXIsDirectFn = |
| 92 reinterpret_cast<glXIsDirectProc>(GetGLProcAddress("glXIsDirect")); | 154 reinterpret_cast<glXIsDirectProc>(GetGLProcAddress("glXIsDirect")); |
| 93 fn.glXMakeContextCurrentFn = reinterpret_cast<glXMakeContextCurrentProc>( | 155 fn.glXMakeContextCurrentFn = reinterpret_cast<glXMakeContextCurrentProc>( |
| 94 GetGLProcAddress("glXMakeContextCurrent")); | 156 GetGLProcAddress("glXMakeContextCurrent")); |
| 95 fn.glXMakeCurrentFn = | 157 fn.glXMakeCurrentFn = |
| 96 reinterpret_cast<glXMakeCurrentProc>(GetGLProcAddress("glXMakeCurrent")); | 158 reinterpret_cast<glXMakeCurrentProc>(GetGLProcAddress("glXMakeCurrent")); |
| 97 fn.glXQueryContextFn = reinterpret_cast<glXQueryContextProc>( | 159 fn.glXQueryContextFn = reinterpret_cast<glXQueryContextProc>( |
| 98 GetGLProcAddress("glXQueryContext")); | 160 GetGLProcAddress("glXQueryContext")); |
| 99 fn.glXQueryDrawableFn = reinterpret_cast<glXQueryDrawableProc>( | 161 fn.glXQueryDrawableFn = reinterpret_cast<glXQueryDrawableProc>( |
| 100 GetGLProcAddress("glXQueryDrawable")); | 162 GetGLProcAddress("glXQueryDrawable")); |
| 101 fn.glXQueryExtensionFn = reinterpret_cast<glXQueryExtensionProc>( | 163 fn.glXQueryExtensionFn = reinterpret_cast<glXQueryExtensionProc>( |
| 102 GetGLProcAddress("glXQueryExtension")); | 164 GetGLProcAddress("glXQueryExtension")); |
| 103 fn.glXQueryExtensionsStringFn = | 165 fn.glXQueryExtensionsStringFn = |
| 104 reinterpret_cast<glXQueryExtensionsStringProc>( | 166 reinterpret_cast<glXQueryExtensionsStringProc>( |
| 105 GetGLProcAddress("glXQueryExtensionsString")); | 167 GetGLProcAddress("glXQueryExtensionsString")); |
| 106 fn.glXQueryServerStringFn = reinterpret_cast<glXQueryServerStringProc>( | 168 fn.glXQueryServerStringFn = reinterpret_cast<glXQueryServerStringProc>( |
| 107 GetGLProcAddress("glXQueryServerString")); | 169 GetGLProcAddress("glXQueryServerString")); |
| 108 fn.glXQueryVersionFn = reinterpret_cast<glXQueryVersionProc>( | 170 fn.glXQueryVersionFn = reinterpret_cast<glXQueryVersionProc>( |
| 109 GetGLProcAddress("glXQueryVersion")); | 171 GetGLProcAddress("glXQueryVersion")); |
| 110 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( | 172 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( |
| 111 GetGLProcAddress("glXReleaseTexImageEXT")); | 173 glXReleaseTexImageEXTNotBound); |
| 112 fn.glXSelectEventFn = | 174 fn.glXSelectEventFn = |
| 113 reinterpret_cast<glXSelectEventProc>(GetGLProcAddress("glXSelectEvent")); | 175 reinterpret_cast<glXSelectEventProc>(GetGLProcAddress("glXSelectEvent")); |
| 114 fn.glXSwapBuffersFn = | 176 fn.glXSwapBuffersFn = |
| 115 reinterpret_cast<glXSwapBuffersProc>(GetGLProcAddress("glXSwapBuffers")); | 177 reinterpret_cast<glXSwapBuffersProc>(GetGLProcAddress("glXSwapBuffers")); |
| 116 fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>( | 178 fn.glXSwapIntervalEXTFn = |
| 117 GetGLProcAddress("glXSwapIntervalEXT")); | 179 reinterpret_cast<glXSwapIntervalEXTProc>(glXSwapIntervalEXTNotBound); |
| 118 fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>( | 180 fn.glXSwapIntervalMESAFn = |
| 119 GetGLProcAddress("glXSwapIntervalMESA")); | 181 reinterpret_cast<glXSwapIntervalMESAProc>(glXSwapIntervalMESANotBound); |
| 120 fn.glXUseXFontFn = | 182 fn.glXUseXFontFn = |
| 121 reinterpret_cast<glXUseXFontProc>(GetGLProcAddress("glXUseXFont")); | 183 reinterpret_cast<glXUseXFontProc>(GetGLProcAddress("glXUseXFont")); |
| 122 fn.glXWaitGLFn = | 184 fn.glXWaitGLFn = |
| 123 reinterpret_cast<glXWaitGLProc>(GetGLProcAddress("glXWaitGL")); | 185 reinterpret_cast<glXWaitGLProc>(GetGLProcAddress("glXWaitGL")); |
| 124 fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>( | 186 fn.glXWaitVideoSyncSGIFn = |
| 125 GetGLProcAddress("glXWaitVideoSyncSGI")); | 187 reinterpret_cast<glXWaitVideoSyncSGIProc>(glXWaitVideoSyncSGINotBound); |
| 126 fn.glXWaitXFn = reinterpret_cast<glXWaitXProc>(GetGLProcAddress("glXWaitX")); | 188 fn.glXWaitXFn = reinterpret_cast<glXWaitXProc>(GetGLProcAddress("glXWaitX")); |
| 127 } | 189 std::string extensions(GetPlatformExtensions()); |
| 128 | 190 extensions += " "; |
| 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); | 191 ALLOW_UNUSED_LOCAL(extensions); |
| 135 | 192 |
| 136 ext.b_GLX_ARB_create_context = | 193 ext.b_GLX_ARB_create_context = |
| 137 extensions.find("GLX_ARB_create_context ") != std::string::npos; | 194 extensions.find("GLX_ARB_create_context ") != std::string::npos; |
| 138 ext.b_GLX_EXT_swap_control = | 195 ext.b_GLX_EXT_swap_control = |
| 139 extensions.find("GLX_EXT_swap_control ") != std::string::npos; | 196 extensions.find("GLX_EXT_swap_control ") != std::string::npos; |
| 140 ext.b_GLX_EXT_texture_from_pixmap = | 197 ext.b_GLX_EXT_texture_from_pixmap = |
| 141 extensions.find("GLX_EXT_texture_from_pixmap ") != std::string::npos; | 198 extensions.find("GLX_EXT_texture_from_pixmap ") != std::string::npos; |
| 142 ext.b_GLX_MESA_copy_sub_buffer = | 199 ext.b_GLX_MESA_copy_sub_buffer = |
| 143 extensions.find("GLX_MESA_copy_sub_buffer ") != std::string::npos; | 200 extensions.find("GLX_MESA_copy_sub_buffer ") != std::string::npos; |
| 144 ext.b_GLX_MESA_swap_control = | 201 ext.b_GLX_MESA_swap_control = |
| 145 extensions.find("GLX_MESA_swap_control ") != std::string::npos; | 202 extensions.find("GLX_MESA_swap_control ") != std::string::npos; |
| 146 ext.b_GLX_OML_sync_control = | 203 ext.b_GLX_OML_sync_control = |
| 147 extensions.find("GLX_OML_sync_control ") != std::string::npos; | 204 extensions.find("GLX_OML_sync_control ") != std::string::npos; |
| 148 ext.b_GLX_SGIX_fbconfig = | 205 ext.b_GLX_SGIX_fbconfig = |
| 149 extensions.find("GLX_SGIX_fbconfig ") != std::string::npos; | 206 extensions.find("GLX_SGIX_fbconfig ") != std::string::npos; |
| 150 ext.b_GLX_SGI_video_sync = | 207 ext.b_GLX_SGI_video_sync = |
| 151 extensions.find("GLX_SGI_video_sync ") != std::string::npos; | 208 extensions.find("GLX_SGI_video_sync ") != std::string::npos; |
| 152 | 209 |
| 210 fn.glXBindTexImageEXTFn = 0; |
| 211 debug_fn.glXBindTexImageEXTFn = 0; |
| 212 if (ext.b_GLX_EXT_texture_from_pixmap) { |
| 213 fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>( |
| 214 GetGLProcAddress("glXBindTexImageEXT")); |
| 215 } else { |
| 216 fn.glXBindTexImageEXTFn = |
| 217 reinterpret_cast<glXBindTexImageEXTProc>(glXBindTexImageEXTNotBound); |
| 218 } |
| 219 DCHECK(fn.glXBindTexImageEXTFn); |
| 220 |
| 221 fn.glXCopySubBufferMESAFn = 0; |
| 222 debug_fn.glXCopySubBufferMESAFn = 0; |
| 223 if (ext.b_GLX_MESA_copy_sub_buffer) { |
| 224 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>( |
| 225 GetGLProcAddress("glXCopySubBufferMESA")); |
| 226 } else { |
| 227 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>( |
| 228 glXCopySubBufferMESANotBound); |
| 229 } |
| 230 DCHECK(fn.glXCopySubBufferMESAFn); |
| 231 |
| 232 fn.glXCreateContextAttribsARBFn = 0; |
| 233 debug_fn.glXCreateContextAttribsARBFn = 0; |
| 234 if (ext.b_GLX_ARB_create_context) { |
| 235 fn.glXCreateContextAttribsARBFn = |
| 236 reinterpret_cast<glXCreateContextAttribsARBProc>( |
| 237 GetGLProcAddress("glXCreateContextAttribsARB")); |
| 238 } else { |
| 239 fn.glXCreateContextAttribsARBFn = |
| 240 reinterpret_cast<glXCreateContextAttribsARBProc>( |
| 241 glXCreateContextAttribsARBNotBound); |
| 242 } |
| 243 DCHECK(fn.glXCreateContextAttribsARBFn); |
| 244 |
| 245 fn.glXGetFBConfigFromVisualSGIXFn = 0; |
| 246 debug_fn.glXGetFBConfigFromVisualSGIXFn = 0; |
| 247 if (ext.b_GLX_SGIX_fbconfig) { |
| 248 fn.glXGetFBConfigFromVisualSGIXFn = |
| 249 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( |
| 250 GetGLProcAddress("glXGetFBConfigFromVisualSGIX")); |
| 251 } else { |
| 252 fn.glXGetFBConfigFromVisualSGIXFn = |
| 253 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( |
| 254 glXGetFBConfigFromVisualSGIXNotBound); |
| 255 } |
| 256 DCHECK(fn.glXGetFBConfigFromVisualSGIXFn); |
| 257 |
| 258 fn.glXGetMscRateOMLFn = 0; |
| 259 debug_fn.glXGetMscRateOMLFn = 0; |
| 260 if (ext.b_GLX_OML_sync_control) { |
| 261 fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>( |
| 262 GetGLProcAddress("glXGetMscRateOML")); |
| 263 } else { |
| 264 fn.glXGetMscRateOMLFn = |
| 265 reinterpret_cast<glXGetMscRateOMLProc>(glXGetMscRateOMLNotBound); |
| 266 } |
| 267 DCHECK(fn.glXGetMscRateOMLFn); |
| 268 |
| 269 fn.glXGetSyncValuesOMLFn = 0; |
| 270 debug_fn.glXGetSyncValuesOMLFn = 0; |
| 271 if (ext.b_GLX_OML_sync_control) { |
| 272 fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>( |
| 273 GetGLProcAddress("glXGetSyncValuesOML")); |
| 274 } else { |
| 275 fn.glXGetSyncValuesOMLFn = |
| 276 reinterpret_cast<glXGetSyncValuesOMLProc>(glXGetSyncValuesOMLNotBound); |
| 277 } |
| 278 DCHECK(fn.glXGetSyncValuesOMLFn); |
| 279 |
| 280 fn.glXReleaseTexImageEXTFn = 0; |
| 281 debug_fn.glXReleaseTexImageEXTFn = 0; |
| 282 if (ext.b_GLX_EXT_texture_from_pixmap) { |
| 283 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( |
| 284 GetGLProcAddress("glXReleaseTexImageEXT")); |
| 285 } else { |
| 286 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( |
| 287 glXReleaseTexImageEXTNotBound); |
| 288 } |
| 289 DCHECK(fn.glXReleaseTexImageEXTFn); |
| 290 |
| 291 fn.glXSwapIntervalEXTFn = 0; |
| 292 debug_fn.glXSwapIntervalEXTFn = 0; |
| 293 if (ext.b_GLX_EXT_swap_control) { |
| 294 fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>( |
| 295 GetGLProcAddress("glXSwapIntervalEXT")); |
| 296 } else { |
| 297 fn.glXSwapIntervalEXTFn = |
| 298 reinterpret_cast<glXSwapIntervalEXTProc>(glXSwapIntervalEXTNotBound); |
| 299 } |
| 300 DCHECK(fn.glXSwapIntervalEXTFn); |
| 301 |
| 302 fn.glXSwapIntervalMESAFn = 0; |
| 303 debug_fn.glXSwapIntervalMESAFn = 0; |
| 304 if (ext.b_GLX_MESA_swap_control) { |
| 305 fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>( |
| 306 GetGLProcAddress("glXSwapIntervalMESA")); |
| 307 } else { |
| 308 fn.glXSwapIntervalMESAFn = |
| 309 reinterpret_cast<glXSwapIntervalMESAProc>(glXSwapIntervalMESANotBound); |
| 310 } |
| 311 DCHECK(fn.glXSwapIntervalMESAFn); |
| 312 |
| 313 fn.glXWaitVideoSyncSGIFn = 0; |
| 314 debug_fn.glXWaitVideoSyncSGIFn = 0; |
| 315 if (ext.b_GLX_SGI_video_sync) { |
| 316 fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>( |
| 317 GetGLProcAddress("glXWaitVideoSyncSGI")); |
| 318 } else { |
| 319 fn.glXWaitVideoSyncSGIFn = |
| 320 reinterpret_cast<glXWaitVideoSyncSGIProc>(glXWaitVideoSyncSGINotBound); |
| 321 } |
| 322 DCHECK(fn.glXWaitVideoSyncSGIFn); |
| 323 |
| 153 if (g_debugBindingsInitialized) | 324 if (g_debugBindingsInitialized) |
| 154 InitializeDebugBindings(); | 325 InitializeDebugBindings(); |
| 155 } | 326 } |
| 156 | 327 |
| 157 extern "C" { | 328 extern "C" { |
| 158 | 329 |
| 159 static void GL_BINDING_CALL Debug_glXBindTexImageEXT(Display* dpy, | 330 static void GL_BINDING_CALL Debug_glXBindTexImageEXT(Display* dpy, |
| 160 GLXDrawable drawable, | 331 GLXDrawable drawable, |
| 161 int buffer, | 332 int buffer, |
| 162 int* attribList) { | 333 int* attribList) { |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI") | 1625 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI") |
| 1455 return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count); | 1626 return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count); |
| 1456 } | 1627 } |
| 1457 | 1628 |
| 1458 void TraceGLXApi::glXWaitXFn(void) { | 1629 void TraceGLXApi::glXWaitXFn(void) { |
| 1459 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX") | 1630 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX") |
| 1460 glx_api_->glXWaitXFn(); | 1631 glx_api_->glXWaitXFn(); |
| 1461 } | 1632 } |
| 1462 | 1633 |
| 1463 } // namespace gfx | 1634 } // namespace gfx |
| OLD | NEW |