Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: ui/gl/gl_bindings_autogen_glx.cc

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_bindings_autogen_gl4.cc ('k') | ui/gl/gl_bindings_autogen_osmesa.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/trace_event/trace_event.h" 13 #include "base/trace_event/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 gl { 21 namespace gl {
22 22
23 static bool g_debugBindingsInitialized;
24 DriverGLX g_driver_glx; 23 DriverGLX g_driver_glx;
25 24
26 void DriverGLX::InitializeStaticBindings() { 25 void DriverGLX::InitializeStaticBindings() {
27 fn.glXBindTexImageEXTFn = 0; 26 fn.glXBindTexImageEXTFn = 0;
28 fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>( 27 fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>(
29 GetGLProcAddress("glXChooseFBConfig")); 28 GetGLProcAddress("glXChooseFBConfig"));
30 fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>( 29 fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>(
31 GetGLProcAddress("glXChooseVisual")); 30 GetGLProcAddress("glXChooseVisual"));
32 fn.glXCopyContextFn = 31 fn.glXCopyContextFn =
33 reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext")); 32 reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext"));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 extensions.find("GLX_MESA_copy_sub_buffer ") != std::string::npos; 128 extensions.find("GLX_MESA_copy_sub_buffer ") != std::string::npos;
130 ext.b_GLX_MESA_swap_control = 129 ext.b_GLX_MESA_swap_control =
131 extensions.find("GLX_MESA_swap_control ") != std::string::npos; 130 extensions.find("GLX_MESA_swap_control ") != std::string::npos;
132 ext.b_GLX_OML_sync_control = 131 ext.b_GLX_OML_sync_control =
133 extensions.find("GLX_OML_sync_control ") != std::string::npos; 132 extensions.find("GLX_OML_sync_control ") != std::string::npos;
134 ext.b_GLX_SGIX_fbconfig = 133 ext.b_GLX_SGIX_fbconfig =
135 extensions.find("GLX_SGIX_fbconfig ") != std::string::npos; 134 extensions.find("GLX_SGIX_fbconfig ") != std::string::npos;
136 ext.b_GLX_SGI_video_sync = 135 ext.b_GLX_SGI_video_sync =
137 extensions.find("GLX_SGI_video_sync ") != std::string::npos; 136 extensions.find("GLX_SGI_video_sync ") != std::string::npos;
138 137
139 debug_fn.glXBindTexImageEXTFn = 0;
140 if (ext.b_GLX_EXT_texture_from_pixmap) { 138 if (ext.b_GLX_EXT_texture_from_pixmap) {
141 fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>( 139 fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>(
142 GetGLProcAddress("glXBindTexImageEXT")); 140 GetGLProcAddress("glXBindTexImageEXT"));
143 } 141 }
144 142
145 debug_fn.glXCopySubBufferMESAFn = 0;
146 if (ext.b_GLX_MESA_copy_sub_buffer) { 143 if (ext.b_GLX_MESA_copy_sub_buffer) {
147 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>( 144 fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>(
148 GetGLProcAddress("glXCopySubBufferMESA")); 145 GetGLProcAddress("glXCopySubBufferMESA"));
149 } 146 }
150 147
151 debug_fn.glXCreateContextAttribsARBFn = 0;
152 if (ext.b_GLX_ARB_create_context) { 148 if (ext.b_GLX_ARB_create_context) {
153 fn.glXCreateContextAttribsARBFn = 149 fn.glXCreateContextAttribsARBFn =
154 reinterpret_cast<glXCreateContextAttribsARBProc>( 150 reinterpret_cast<glXCreateContextAttribsARBProc>(
155 GetGLProcAddress("glXCreateContextAttribsARB")); 151 GetGLProcAddress("glXCreateContextAttribsARB"));
156 } 152 }
157 153
158 debug_fn.glXGetFBConfigFromVisualSGIXFn = 0;
159 if (ext.b_GLX_SGIX_fbconfig) { 154 if (ext.b_GLX_SGIX_fbconfig) {
160 fn.glXGetFBConfigFromVisualSGIXFn = 155 fn.glXGetFBConfigFromVisualSGIXFn =
161 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>( 156 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>(
162 GetGLProcAddress("glXGetFBConfigFromVisualSGIX")); 157 GetGLProcAddress("glXGetFBConfigFromVisualSGIX"));
163 } 158 }
164 159
165 debug_fn.glXGetMscRateOMLFn = 0;
166 if (ext.b_GLX_OML_sync_control) { 160 if (ext.b_GLX_OML_sync_control) {
167 fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>( 161 fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>(
168 GetGLProcAddress("glXGetMscRateOML")); 162 GetGLProcAddress("glXGetMscRateOML"));
169 } 163 }
170 164
171 debug_fn.glXGetSyncValuesOMLFn = 0;
172 if (ext.b_GLX_OML_sync_control) { 165 if (ext.b_GLX_OML_sync_control) {
173 fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>( 166 fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>(
174 GetGLProcAddress("glXGetSyncValuesOML")); 167 GetGLProcAddress("glXGetSyncValuesOML"));
175 } 168 }
176 169
177 debug_fn.glXReleaseTexImageEXTFn = 0;
178 if (ext.b_GLX_EXT_texture_from_pixmap) { 170 if (ext.b_GLX_EXT_texture_from_pixmap) {
179 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>( 171 fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>(
180 GetGLProcAddress("glXReleaseTexImageEXT")); 172 GetGLProcAddress("glXReleaseTexImageEXT"));
181 } 173 }
182 174
183 debug_fn.glXSwapIntervalEXTFn = 0;
184 if (ext.b_GLX_EXT_swap_control) { 175 if (ext.b_GLX_EXT_swap_control) {
185 fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>( 176 fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>(
186 GetGLProcAddress("glXSwapIntervalEXT")); 177 GetGLProcAddress("glXSwapIntervalEXT"));
187 } 178 }
188 179
189 debug_fn.glXSwapIntervalMESAFn = 0;
190 if (ext.b_GLX_MESA_swap_control) { 180 if (ext.b_GLX_MESA_swap_control) {
191 fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>( 181 fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>(
192 GetGLProcAddress("glXSwapIntervalMESA")); 182 GetGLProcAddress("glXSwapIntervalMESA"));
193 } 183 }
194 184
195 debug_fn.glXWaitVideoSyncSGIFn = 0;
196 if (ext.b_GLX_SGI_video_sync) { 185 if (ext.b_GLX_SGI_video_sync) {
197 fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>( 186 fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>(
198 GetGLProcAddress("glXWaitVideoSyncSGI")); 187 GetGLProcAddress("glXWaitVideoSyncSGI"));
199 } 188 }
200
201 if (g_debugBindingsInitialized)
202 InitializeDebugBindings();
203 }
204
205 extern "C" {
206
207 static void GL_BINDING_CALL Debug_glXBindTexImageEXT(Display* dpy,
208 GLXDrawable drawable,
209 int buffer,
210 int* attribList) {
211 GL_SERVICE_LOG("glXBindTexImageEXT"
212 << "(" << static_cast<const void*>(dpy) << ", " << drawable
213 << ", " << buffer << ", "
214 << static_cast<const void*>(attribList) << ")");
215 DCHECK(g_driver_glx.debug_fn.glXBindTexImageEXTFn != nullptr);
216 g_driver_glx.debug_fn.glXBindTexImageEXTFn(dpy, drawable, buffer, attribList);
217 }
218
219 static GLXFBConfig* GL_BINDING_CALL
220 Debug_glXChooseFBConfig(Display* dpy,
221 int screen,
222 const int* attribList,
223 int* nitems) {
224 GL_SERVICE_LOG("glXChooseFBConfig"
225 << "(" << static_cast<const void*>(dpy) << ", " << screen
226 << ", " << static_cast<const void*>(attribList) << ", "
227 << static_cast<const void*>(nitems) << ")");
228 DCHECK(g_driver_glx.debug_fn.glXChooseFBConfigFn != nullptr);
229 GLXFBConfig* result = g_driver_glx.debug_fn.glXChooseFBConfigFn(
230 dpy, screen, attribList, nitems);
231 GL_SERVICE_LOG("GL_RESULT: " << result);
232 return result;
233 }
234
235 static XVisualInfo* GL_BINDING_CALL Debug_glXChooseVisual(Display* dpy,
236 int screen,
237 int* attribList) {
238 GL_SERVICE_LOG("glXChooseVisual"
239 << "(" << static_cast<const void*>(dpy) << ", " << screen
240 << ", " << static_cast<const void*>(attribList) << ")");
241 DCHECK(g_driver_glx.debug_fn.glXChooseVisualFn != nullptr);
242 XVisualInfo* result =
243 g_driver_glx.debug_fn.glXChooseVisualFn(dpy, screen, attribList);
244 GL_SERVICE_LOG("GL_RESULT: " << result);
245 return result;
246 }
247
248 static void GL_BINDING_CALL Debug_glXCopyContext(Display* dpy,
249 GLXContext src,
250 GLXContext dst,
251 unsigned long mask) {
252 GL_SERVICE_LOG("glXCopyContext"
253 << "(" << static_cast<const void*>(dpy) << ", " << src << ", "
254 << dst << ", " << mask << ")");
255 DCHECK(g_driver_glx.debug_fn.glXCopyContextFn != nullptr);
256 g_driver_glx.debug_fn.glXCopyContextFn(dpy, src, dst, mask);
257 }
258
259 static void GL_BINDING_CALL Debug_glXCopySubBufferMESA(Display* dpy,
260 GLXDrawable drawable,
261 int x,
262 int y,
263 int width,
264 int height) {
265 GL_SERVICE_LOG("glXCopySubBufferMESA"
266 << "(" << static_cast<const void*>(dpy) << ", " << drawable
267 << ", " << x << ", " << y << ", " << width << ", " << height
268 << ")");
269 DCHECK(g_driver_glx.debug_fn.glXCopySubBufferMESAFn != nullptr);
270 g_driver_glx.debug_fn.glXCopySubBufferMESAFn(dpy, drawable, x, y, width,
271 height);
272 }
273
274 static GLXContext GL_BINDING_CALL Debug_glXCreateContext(Display* dpy,
275 XVisualInfo* vis,
276 GLXContext shareList,
277 int direct) {
278 GL_SERVICE_LOG("glXCreateContext"
279 << "(" << static_cast<const void*>(dpy) << ", "
280 << static_cast<const void*>(vis) << ", " << shareList << ", "
281 << direct << ")");
282 DCHECK(g_driver_glx.debug_fn.glXCreateContextFn != nullptr);
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 DCHECK(g_driver_glx.debug_fn.glXCreateContextAttribsARBFn != nullptr);
300 GLXContext result = g_driver_glx.debug_fn.glXCreateContextAttribsARBFn(
301 dpy, config, share_context, direct, attrib_list);
302 GL_SERVICE_LOG("GL_RESULT: " << result);
303 return result;
304 }
305
306 static GLXPixmap GL_BINDING_CALL Debug_glXCreateGLXPixmap(Display* dpy,
307 XVisualInfo* visual,
308 Pixmap pixmap) {
309 GL_SERVICE_LOG("glXCreateGLXPixmap"
310 << "(" << static_cast<const void*>(dpy) << ", "
311 << static_cast<const void*>(visual) << ", " << pixmap << ")");
312 DCHECK(g_driver_glx.debug_fn.glXCreateGLXPixmapFn != nullptr);
313 GLXPixmap result =
314 g_driver_glx.debug_fn.glXCreateGLXPixmapFn(dpy, visual, pixmap);
315 GL_SERVICE_LOG("GL_RESULT: " << result);
316 return result;
317 }
318
319 static GLXContext GL_BINDING_CALL
320 Debug_glXCreateNewContext(Display* dpy,
321 GLXFBConfig config,
322 int renderType,
323 GLXContext shareList,
324 int direct) {
325 GL_SERVICE_LOG("glXCreateNewContext"
326 << "(" << static_cast<const void*>(dpy) << ", " << config
327 << ", " << renderType << ", " << shareList << ", " << direct
328 << ")");
329 DCHECK(g_driver_glx.debug_fn.glXCreateNewContextFn != nullptr);
330 GLXContext result = g_driver_glx.debug_fn.glXCreateNewContextFn(
331 dpy, config, renderType, shareList, direct);
332 GL_SERVICE_LOG("GL_RESULT: " << result);
333 return result;
334 }
335
336 static GLXPbuffer GL_BINDING_CALL
337 Debug_glXCreatePbuffer(Display* dpy,
338 GLXFBConfig config,
339 const int* attribList) {
340 GL_SERVICE_LOG("glXCreatePbuffer"
341 << "(" << static_cast<const void*>(dpy) << ", " << config
342 << ", " << static_cast<const void*>(attribList) << ")");
343 DCHECK(g_driver_glx.debug_fn.glXCreatePbufferFn != nullptr);
344 GLXPbuffer result =
345 g_driver_glx.debug_fn.glXCreatePbufferFn(dpy, config, attribList);
346 GL_SERVICE_LOG("GL_RESULT: " << result);
347 return result;
348 }
349
350 static GLXPixmap GL_BINDING_CALL Debug_glXCreatePixmap(Display* dpy,
351 GLXFBConfig config,
352 Pixmap pixmap,
353 const int* attribList) {
354 GL_SERVICE_LOG("glXCreatePixmap"
355 << "(" << static_cast<const void*>(dpy) << ", " << config
356 << ", " << pixmap << ", "
357 << static_cast<const void*>(attribList) << ")");
358 DCHECK(g_driver_glx.debug_fn.glXCreatePixmapFn != nullptr);
359 GLXPixmap result =
360 g_driver_glx.debug_fn.glXCreatePixmapFn(dpy, config, pixmap, attribList);
361 GL_SERVICE_LOG("GL_RESULT: " << result);
362 return result;
363 }
364
365 static GLXWindow GL_BINDING_CALL Debug_glXCreateWindow(Display* dpy,
366 GLXFBConfig config,
367 Window win,
368 const int* attribList) {
369 GL_SERVICE_LOG("glXCreateWindow"
370 << "(" << static_cast<const void*>(dpy) << ", " << config
371 << ", " << win << ", " << static_cast<const void*>(attribList)
372 << ")");
373 DCHECK(g_driver_glx.debug_fn.glXCreateWindowFn != nullptr);
374 GLXWindow result =
375 g_driver_glx.debug_fn.glXCreateWindowFn(dpy, config, win, attribList);
376 GL_SERVICE_LOG("GL_RESULT: " << result);
377 return result;
378 }
379
380 static void GL_BINDING_CALL Debug_glXDestroyContext(Display* dpy,
381 GLXContext ctx) {
382 GL_SERVICE_LOG("glXDestroyContext"
383 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
384 DCHECK(g_driver_glx.debug_fn.glXDestroyContextFn != nullptr);
385 g_driver_glx.debug_fn.glXDestroyContextFn(dpy, ctx);
386 }
387
388 static void GL_BINDING_CALL Debug_glXDestroyGLXPixmap(Display* dpy,
389 GLXPixmap pixmap) {
390 GL_SERVICE_LOG("glXDestroyGLXPixmap"
391 << "(" << static_cast<const void*>(dpy) << ", " << pixmap
392 << ")");
393 DCHECK(g_driver_glx.debug_fn.glXDestroyGLXPixmapFn != nullptr);
394 g_driver_glx.debug_fn.glXDestroyGLXPixmapFn(dpy, pixmap);
395 }
396
397 static void GL_BINDING_CALL Debug_glXDestroyPbuffer(Display* dpy,
398 GLXPbuffer pbuf) {
399 GL_SERVICE_LOG("glXDestroyPbuffer"
400 << "(" << static_cast<const void*>(dpy) << ", " << pbuf
401 << ")");
402 DCHECK(g_driver_glx.debug_fn.glXDestroyPbufferFn != nullptr);
403 g_driver_glx.debug_fn.glXDestroyPbufferFn(dpy, pbuf);
404 }
405
406 static void GL_BINDING_CALL Debug_glXDestroyPixmap(Display* dpy,
407 GLXPixmap pixmap) {
408 GL_SERVICE_LOG("glXDestroyPixmap"
409 << "(" << static_cast<const void*>(dpy) << ", " << pixmap
410 << ")");
411 DCHECK(g_driver_glx.debug_fn.glXDestroyPixmapFn != nullptr);
412 g_driver_glx.debug_fn.glXDestroyPixmapFn(dpy, pixmap);
413 }
414
415 static void GL_BINDING_CALL Debug_glXDestroyWindow(Display* dpy,
416 GLXWindow window) {
417 GL_SERVICE_LOG("glXDestroyWindow"
418 << "(" << static_cast<const void*>(dpy) << ", " << window
419 << ")");
420 DCHECK(g_driver_glx.debug_fn.glXDestroyWindowFn != nullptr);
421 g_driver_glx.debug_fn.glXDestroyWindowFn(dpy, window);
422 }
423
424 static const char* GL_BINDING_CALL Debug_glXGetClientString(Display* dpy,
425 int name) {
426 GL_SERVICE_LOG("glXGetClientString"
427 << "(" << static_cast<const void*>(dpy) << ", " << name
428 << ")");
429 DCHECK(g_driver_glx.debug_fn.glXGetClientStringFn != nullptr);
430 const char* result = g_driver_glx.debug_fn.glXGetClientStringFn(dpy, name);
431 GL_SERVICE_LOG("GL_RESULT: " << result);
432 return result;
433 }
434
435 static int GL_BINDING_CALL Debug_glXGetConfig(Display* dpy,
436 XVisualInfo* visual,
437 int attrib,
438 int* value) {
439 GL_SERVICE_LOG("glXGetConfig"
440 << "(" << static_cast<const void*>(dpy) << ", "
441 << static_cast<const void*>(visual) << ", " << attrib << ", "
442 << static_cast<const void*>(value) << ")");
443 DCHECK(g_driver_glx.debug_fn.glXGetConfigFn != nullptr);
444 int result = g_driver_glx.debug_fn.glXGetConfigFn(dpy, visual, attrib, value);
445 GL_SERVICE_LOG("GL_RESULT: " << result);
446 return result;
447 }
448
449 static GLXContext GL_BINDING_CALL Debug_glXGetCurrentContext(void) {
450 GL_SERVICE_LOG("glXGetCurrentContext"
451 << "("
452 << ")");
453 DCHECK(g_driver_glx.debug_fn.glXGetCurrentContextFn != nullptr);
454 GLXContext result = g_driver_glx.debug_fn.glXGetCurrentContextFn();
455 GL_SERVICE_LOG("GL_RESULT: " << result);
456 return result;
457 }
458
459 static Display* GL_BINDING_CALL Debug_glXGetCurrentDisplay(void) {
460 GL_SERVICE_LOG("glXGetCurrentDisplay"
461 << "("
462 << ")");
463 DCHECK(g_driver_glx.debug_fn.glXGetCurrentDisplayFn != nullptr);
464 Display* result = g_driver_glx.debug_fn.glXGetCurrentDisplayFn();
465 GL_SERVICE_LOG("GL_RESULT: " << result);
466 return result;
467 }
468
469 static GLXDrawable GL_BINDING_CALL Debug_glXGetCurrentDrawable(void) {
470 GL_SERVICE_LOG("glXGetCurrentDrawable"
471 << "("
472 << ")");
473 DCHECK(g_driver_glx.debug_fn.glXGetCurrentDrawableFn != nullptr);
474 GLXDrawable result = g_driver_glx.debug_fn.glXGetCurrentDrawableFn();
475 GL_SERVICE_LOG("GL_RESULT: " << result);
476 return result;
477 }
478
479 static GLXDrawable GL_BINDING_CALL Debug_glXGetCurrentReadDrawable(void) {
480 GL_SERVICE_LOG("glXGetCurrentReadDrawable"
481 << "("
482 << ")");
483 DCHECK(g_driver_glx.debug_fn.glXGetCurrentReadDrawableFn != nullptr);
484 GLXDrawable result = g_driver_glx.debug_fn.glXGetCurrentReadDrawableFn();
485 GL_SERVICE_LOG("GL_RESULT: " << result);
486 return result;
487 }
488
489 static int GL_BINDING_CALL Debug_glXGetFBConfigAttrib(Display* dpy,
490 GLXFBConfig config,
491 int attribute,
492 int* value) {
493 GL_SERVICE_LOG("glXGetFBConfigAttrib"
494 << "(" << static_cast<const void*>(dpy) << ", " << config
495 << ", " << attribute << ", " << static_cast<const void*>(value)
496 << ")");
497 DCHECK(g_driver_glx.debug_fn.glXGetFBConfigAttribFn != nullptr);
498 int result = g_driver_glx.debug_fn.glXGetFBConfigAttribFn(dpy, config,
499 attribute, value);
500 GL_SERVICE_LOG("GL_RESULT: " << result);
501 return result;
502 }
503
504 static GLXFBConfig GL_BINDING_CALL
505 Debug_glXGetFBConfigFromVisualSGIX(Display* dpy, XVisualInfo* visualInfo) {
506 GL_SERVICE_LOG("glXGetFBConfigFromVisualSGIX"
507 << "(" << static_cast<const void*>(dpy) << ", "
508 << static_cast<const void*>(visualInfo) << ")");
509 DCHECK(g_driver_glx.debug_fn.glXGetFBConfigFromVisualSGIXFn != nullptr);
510 GLXFBConfig result =
511 g_driver_glx.debug_fn.glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo);
512 GL_SERVICE_LOG("GL_RESULT: " << result);
513 return result;
514 }
515
516 static GLXFBConfig* GL_BINDING_CALL Debug_glXGetFBConfigs(Display* dpy,
517 int screen,
518 int* nelements) {
519 GL_SERVICE_LOG("glXGetFBConfigs"
520 << "(" << static_cast<const void*>(dpy) << ", " << screen
521 << ", " << static_cast<const void*>(nelements) << ")");
522 DCHECK(g_driver_glx.debug_fn.glXGetFBConfigsFn != nullptr);
523 GLXFBConfig* result =
524 g_driver_glx.debug_fn.glXGetFBConfigsFn(dpy, screen, nelements);
525 GL_SERVICE_LOG("GL_RESULT: " << result);
526 return result;
527 }
528
529 static bool GL_BINDING_CALL Debug_glXGetMscRateOML(Display* dpy,
530 GLXDrawable drawable,
531 int32_t* numerator,
532 int32_t* denominator) {
533 GL_SERVICE_LOG("glXGetMscRateOML"
534 << "(" << static_cast<const void*>(dpy) << ", " << drawable
535 << ", " << static_cast<const void*>(numerator) << ", "
536 << static_cast<const void*>(denominator) << ")");
537 DCHECK(g_driver_glx.debug_fn.glXGetMscRateOMLFn != nullptr);
538 bool result = g_driver_glx.debug_fn.glXGetMscRateOMLFn(
539 dpy, drawable, numerator, denominator);
540 GL_SERVICE_LOG("GL_RESULT: " << result);
541 return result;
542 }
543
544 static void GL_BINDING_CALL Debug_glXGetSelectedEvent(Display* dpy,
545 GLXDrawable drawable,
546 unsigned long* mask) {
547 GL_SERVICE_LOG("glXGetSelectedEvent"
548 << "(" << static_cast<const void*>(dpy) << ", " << drawable
549 << ", " << static_cast<const void*>(mask) << ")");
550 DCHECK(g_driver_glx.debug_fn.glXGetSelectedEventFn != nullptr);
551 g_driver_glx.debug_fn.glXGetSelectedEventFn(dpy, drawable, mask);
552 }
553
554 static bool GL_BINDING_CALL Debug_glXGetSyncValuesOML(Display* dpy,
555 GLXDrawable drawable,
556 int64_t* ust,
557 int64_t* msc,
558 int64_t* sbc) {
559 GL_SERVICE_LOG("glXGetSyncValuesOML"
560 << "(" << static_cast<const void*>(dpy) << ", " << drawable
561 << ", " << static_cast<const void*>(ust) << ", "
562 << static_cast<const void*>(msc) << ", "
563 << static_cast<const void*>(sbc) << ")");
564 DCHECK(g_driver_glx.debug_fn.glXGetSyncValuesOMLFn != nullptr);
565 bool result =
566 g_driver_glx.debug_fn.glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc);
567 GL_SERVICE_LOG("GL_RESULT: " << result);
568 return result;
569 }
570
571 static XVisualInfo* GL_BINDING_CALL
572 Debug_glXGetVisualFromFBConfig(Display* dpy, GLXFBConfig config) {
573 GL_SERVICE_LOG("glXGetVisualFromFBConfig"
574 << "(" << static_cast<const void*>(dpy) << ", " << config
575 << ")");
576 DCHECK(g_driver_glx.debug_fn.glXGetVisualFromFBConfigFn != nullptr);
577 XVisualInfo* result =
578 g_driver_glx.debug_fn.glXGetVisualFromFBConfigFn(dpy, config);
579 GL_SERVICE_LOG("GL_RESULT: " << result);
580 return result;
581 }
582
583 static int GL_BINDING_CALL Debug_glXIsDirect(Display* dpy, GLXContext ctx) {
584 GL_SERVICE_LOG("glXIsDirect"
585 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
586 DCHECK(g_driver_glx.debug_fn.glXIsDirectFn != nullptr);
587 int result = g_driver_glx.debug_fn.glXIsDirectFn(dpy, ctx);
588 GL_SERVICE_LOG("GL_RESULT: " << result);
589 return result;
590 }
591
592 static int GL_BINDING_CALL Debug_glXMakeContextCurrent(Display* dpy,
593 GLXDrawable draw,
594 GLXDrawable read,
595 GLXContext ctx) {
596 GL_SERVICE_LOG("glXMakeContextCurrent"
597 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
598 << read << ", " << ctx << ")");
599 DCHECK(g_driver_glx.debug_fn.glXMakeContextCurrentFn != nullptr);
600 int result =
601 g_driver_glx.debug_fn.glXMakeContextCurrentFn(dpy, draw, read, ctx);
602 GL_SERVICE_LOG("GL_RESULT: " << result);
603 return result;
604 }
605
606 static int GL_BINDING_CALL Debug_glXMakeCurrent(Display* dpy,
607 GLXDrawable drawable,
608 GLXContext ctx) {
609 GL_SERVICE_LOG("glXMakeCurrent"
610 << "(" << static_cast<const void*>(dpy) << ", " << drawable
611 << ", " << ctx << ")");
612 DCHECK(g_driver_glx.debug_fn.glXMakeCurrentFn != nullptr);
613 int result = g_driver_glx.debug_fn.glXMakeCurrentFn(dpy, drawable, ctx);
614 GL_SERVICE_LOG("GL_RESULT: " << result);
615 return result;
616 }
617
618 static int GL_BINDING_CALL Debug_glXQueryContext(Display* dpy,
619 GLXContext ctx,
620 int attribute,
621 int* value) {
622 GL_SERVICE_LOG("glXQueryContext"
623 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ", "
624 << attribute << ", " << static_cast<const void*>(value)
625 << ")");
626 DCHECK(g_driver_glx.debug_fn.glXQueryContextFn != nullptr);
627 int result =
628 g_driver_glx.debug_fn.glXQueryContextFn(dpy, ctx, attribute, value);
629 GL_SERVICE_LOG("GL_RESULT: " << result);
630 return result;
631 }
632
633 static void GL_BINDING_CALL Debug_glXQueryDrawable(Display* dpy,
634 GLXDrawable draw,
635 int attribute,
636 unsigned int* value) {
637 GL_SERVICE_LOG("glXQueryDrawable"
638 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
639 << attribute << ", " << static_cast<const void*>(value)
640 << ")");
641 DCHECK(g_driver_glx.debug_fn.glXQueryDrawableFn != nullptr);
642 g_driver_glx.debug_fn.glXQueryDrawableFn(dpy, draw, attribute, value);
643 }
644
645 static int GL_BINDING_CALL Debug_glXQueryExtension(Display* dpy,
646 int* errorb,
647 int* event) {
648 GL_SERVICE_LOG("glXQueryExtension"
649 << "(" << static_cast<const void*>(dpy) << ", "
650 << static_cast<const void*>(errorb) << ", "
651 << static_cast<const void*>(event) << ")");
652 DCHECK(g_driver_glx.debug_fn.glXQueryExtensionFn != nullptr);
653 int result = g_driver_glx.debug_fn.glXQueryExtensionFn(dpy, errorb, event);
654 GL_SERVICE_LOG("GL_RESULT: " << result);
655 return result;
656 }
657
658 static const char* GL_BINDING_CALL Debug_glXQueryExtensionsString(Display* dpy,
659 int screen) {
660 GL_SERVICE_LOG("glXQueryExtensionsString"
661 << "(" << static_cast<const void*>(dpy) << ", " << screen
662 << ")");
663 DCHECK(g_driver_glx.debug_fn.glXQueryExtensionsStringFn != nullptr);
664 const char* result =
665 g_driver_glx.debug_fn.glXQueryExtensionsStringFn(dpy, screen);
666 GL_SERVICE_LOG("GL_RESULT: " << result);
667 return result;
668 }
669
670 static const char* GL_BINDING_CALL Debug_glXQueryServerString(Display* dpy,
671 int screen,
672 int name) {
673 GL_SERVICE_LOG("glXQueryServerString"
674 << "(" << static_cast<const void*>(dpy) << ", " << screen
675 << ", " << name << ")");
676 DCHECK(g_driver_glx.debug_fn.glXQueryServerStringFn != nullptr);
677 const char* result =
678 g_driver_glx.debug_fn.glXQueryServerStringFn(dpy, screen, name);
679 GL_SERVICE_LOG("GL_RESULT: " << result);
680 return result;
681 }
682
683 static int GL_BINDING_CALL Debug_glXQueryVersion(Display* dpy,
684 int* maj,
685 int* min) {
686 GL_SERVICE_LOG("glXQueryVersion"
687 << "(" << static_cast<const void*>(dpy) << ", "
688 << static_cast<const void*>(maj) << ", "
689 << static_cast<const void*>(min) << ")");
690 DCHECK(g_driver_glx.debug_fn.glXQueryVersionFn != nullptr);
691 int result = g_driver_glx.debug_fn.glXQueryVersionFn(dpy, maj, min);
692 GL_SERVICE_LOG("GL_RESULT: " << result);
693 return result;
694 }
695
696 static void GL_BINDING_CALL Debug_glXReleaseTexImageEXT(Display* dpy,
697 GLXDrawable drawable,
698 int buffer) {
699 GL_SERVICE_LOG("glXReleaseTexImageEXT"
700 << "(" << static_cast<const void*>(dpy) << ", " << drawable
701 << ", " << buffer << ")");
702 DCHECK(g_driver_glx.debug_fn.glXReleaseTexImageEXTFn != nullptr);
703 g_driver_glx.debug_fn.glXReleaseTexImageEXTFn(dpy, drawable, buffer);
704 }
705
706 static void GL_BINDING_CALL Debug_glXSelectEvent(Display* dpy,
707 GLXDrawable drawable,
708 unsigned long mask) {
709 GL_SERVICE_LOG("glXSelectEvent"
710 << "(" << static_cast<const void*>(dpy) << ", " << drawable
711 << ", " << mask << ")");
712 DCHECK(g_driver_glx.debug_fn.glXSelectEventFn != nullptr);
713 g_driver_glx.debug_fn.glXSelectEventFn(dpy, drawable, mask);
714 }
715
716 static void GL_BINDING_CALL Debug_glXSwapBuffers(Display* dpy,
717 GLXDrawable drawable) {
718 GL_SERVICE_LOG("glXSwapBuffers"
719 << "(" << static_cast<const void*>(dpy) << ", " << drawable
720 << ")");
721 DCHECK(g_driver_glx.debug_fn.glXSwapBuffersFn != nullptr);
722 g_driver_glx.debug_fn.glXSwapBuffersFn(dpy, drawable);
723 }
724
725 static void GL_BINDING_CALL Debug_glXSwapIntervalEXT(Display* dpy,
726 GLXDrawable drawable,
727 int interval) {
728 GL_SERVICE_LOG("glXSwapIntervalEXT"
729 << "(" << static_cast<const void*>(dpy) << ", " << drawable
730 << ", " << interval << ")");
731 DCHECK(g_driver_glx.debug_fn.glXSwapIntervalEXTFn != nullptr);
732 g_driver_glx.debug_fn.glXSwapIntervalEXTFn(dpy, drawable, interval);
733 }
734
735 static void GL_BINDING_CALL Debug_glXSwapIntervalMESA(unsigned int interval) {
736 GL_SERVICE_LOG("glXSwapIntervalMESA"
737 << "(" << interval << ")");
738 DCHECK(g_driver_glx.debug_fn.glXSwapIntervalMESAFn != nullptr);
739 g_driver_glx.debug_fn.glXSwapIntervalMESAFn(interval);
740 }
741
742 static void GL_BINDING_CALL Debug_glXUseXFont(Font font,
743 int first,
744 int count,
745 int list) {
746 GL_SERVICE_LOG("glXUseXFont"
747 << "(" << font << ", " << first << ", " << count << ", "
748 << list << ")");
749 DCHECK(g_driver_glx.debug_fn.glXUseXFontFn != nullptr);
750 g_driver_glx.debug_fn.glXUseXFontFn(font, first, count, list);
751 }
752
753 static void GL_BINDING_CALL Debug_glXWaitGL(void) {
754 GL_SERVICE_LOG("glXWaitGL"
755 << "("
756 << ")");
757 DCHECK(g_driver_glx.debug_fn.glXWaitGLFn != nullptr);
758 g_driver_glx.debug_fn.glXWaitGLFn();
759 }
760
761 static int GL_BINDING_CALL Debug_glXWaitVideoSyncSGI(int divisor,
762 int remainder,
763 unsigned int* count) {
764 GL_SERVICE_LOG("glXWaitVideoSyncSGI"
765 << "(" << divisor << ", " << remainder << ", "
766 << static_cast<const void*>(count) << ")");
767 DCHECK(g_driver_glx.debug_fn.glXWaitVideoSyncSGIFn != nullptr);
768 int result =
769 g_driver_glx.debug_fn.glXWaitVideoSyncSGIFn(divisor, remainder, count);
770 GL_SERVICE_LOG("GL_RESULT: " << result);
771 return result;
772 }
773
774 static void GL_BINDING_CALL Debug_glXWaitX(void) {
775 GL_SERVICE_LOG("glXWaitX"
776 << "("
777 << ")");
778 DCHECK(g_driver_glx.debug_fn.glXWaitXFn != nullptr);
779 g_driver_glx.debug_fn.glXWaitXFn();
780 }
781 } // extern "C"
782
783 void DriverGLX::InitializeDebugBindings() {
784 if (!debug_fn.glXBindTexImageEXTFn) {
785 debug_fn.glXBindTexImageEXTFn = fn.glXBindTexImageEXTFn;
786 fn.glXBindTexImageEXTFn = Debug_glXBindTexImageEXT;
787 }
788 if (!debug_fn.glXChooseFBConfigFn) {
789 debug_fn.glXChooseFBConfigFn = fn.glXChooseFBConfigFn;
790 fn.glXChooseFBConfigFn = Debug_glXChooseFBConfig;
791 }
792 if (!debug_fn.glXChooseVisualFn) {
793 debug_fn.glXChooseVisualFn = fn.glXChooseVisualFn;
794 fn.glXChooseVisualFn = Debug_glXChooseVisual;
795 }
796 if (!debug_fn.glXCopyContextFn) {
797 debug_fn.glXCopyContextFn = fn.glXCopyContextFn;
798 fn.glXCopyContextFn = Debug_glXCopyContext;
799 }
800 if (!debug_fn.glXCopySubBufferMESAFn) {
801 debug_fn.glXCopySubBufferMESAFn = fn.glXCopySubBufferMESAFn;
802 fn.glXCopySubBufferMESAFn = Debug_glXCopySubBufferMESA;
803 }
804 if (!debug_fn.glXCreateContextFn) {
805 debug_fn.glXCreateContextFn = fn.glXCreateContextFn;
806 fn.glXCreateContextFn = Debug_glXCreateContext;
807 }
808 if (!debug_fn.glXCreateContextAttribsARBFn) {
809 debug_fn.glXCreateContextAttribsARBFn = fn.glXCreateContextAttribsARBFn;
810 fn.glXCreateContextAttribsARBFn = Debug_glXCreateContextAttribsARB;
811 }
812 if (!debug_fn.glXCreateGLXPixmapFn) {
813 debug_fn.glXCreateGLXPixmapFn = fn.glXCreateGLXPixmapFn;
814 fn.glXCreateGLXPixmapFn = Debug_glXCreateGLXPixmap;
815 }
816 if (!debug_fn.glXCreateNewContextFn) {
817 debug_fn.glXCreateNewContextFn = fn.glXCreateNewContextFn;
818 fn.glXCreateNewContextFn = Debug_glXCreateNewContext;
819 }
820 if (!debug_fn.glXCreatePbufferFn) {
821 debug_fn.glXCreatePbufferFn = fn.glXCreatePbufferFn;
822 fn.glXCreatePbufferFn = Debug_glXCreatePbuffer;
823 }
824 if (!debug_fn.glXCreatePixmapFn) {
825 debug_fn.glXCreatePixmapFn = fn.glXCreatePixmapFn;
826 fn.glXCreatePixmapFn = Debug_glXCreatePixmap;
827 }
828 if (!debug_fn.glXCreateWindowFn) {
829 debug_fn.glXCreateWindowFn = fn.glXCreateWindowFn;
830 fn.glXCreateWindowFn = Debug_glXCreateWindow;
831 }
832 if (!debug_fn.glXDestroyContextFn) {
833 debug_fn.glXDestroyContextFn = fn.glXDestroyContextFn;
834 fn.glXDestroyContextFn = Debug_glXDestroyContext;
835 }
836 if (!debug_fn.glXDestroyGLXPixmapFn) {
837 debug_fn.glXDestroyGLXPixmapFn = fn.glXDestroyGLXPixmapFn;
838 fn.glXDestroyGLXPixmapFn = Debug_glXDestroyGLXPixmap;
839 }
840 if (!debug_fn.glXDestroyPbufferFn) {
841 debug_fn.glXDestroyPbufferFn = fn.glXDestroyPbufferFn;
842 fn.glXDestroyPbufferFn = Debug_glXDestroyPbuffer;
843 }
844 if (!debug_fn.glXDestroyPixmapFn) {
845 debug_fn.glXDestroyPixmapFn = fn.glXDestroyPixmapFn;
846 fn.glXDestroyPixmapFn = Debug_glXDestroyPixmap;
847 }
848 if (!debug_fn.glXDestroyWindowFn) {
849 debug_fn.glXDestroyWindowFn = fn.glXDestroyWindowFn;
850 fn.glXDestroyWindowFn = Debug_glXDestroyWindow;
851 }
852 if (!debug_fn.glXGetClientStringFn) {
853 debug_fn.glXGetClientStringFn = fn.glXGetClientStringFn;
854 fn.glXGetClientStringFn = Debug_glXGetClientString;
855 }
856 if (!debug_fn.glXGetConfigFn) {
857 debug_fn.glXGetConfigFn = fn.glXGetConfigFn;
858 fn.glXGetConfigFn = Debug_glXGetConfig;
859 }
860 if (!debug_fn.glXGetCurrentContextFn) {
861 debug_fn.glXGetCurrentContextFn = fn.glXGetCurrentContextFn;
862 fn.glXGetCurrentContextFn = Debug_glXGetCurrentContext;
863 }
864 if (!debug_fn.glXGetCurrentDisplayFn) {
865 debug_fn.glXGetCurrentDisplayFn = fn.glXGetCurrentDisplayFn;
866 fn.glXGetCurrentDisplayFn = Debug_glXGetCurrentDisplay;
867 }
868 if (!debug_fn.glXGetCurrentDrawableFn) {
869 debug_fn.glXGetCurrentDrawableFn = fn.glXGetCurrentDrawableFn;
870 fn.glXGetCurrentDrawableFn = Debug_glXGetCurrentDrawable;
871 }
872 if (!debug_fn.glXGetCurrentReadDrawableFn) {
873 debug_fn.glXGetCurrentReadDrawableFn = fn.glXGetCurrentReadDrawableFn;
874 fn.glXGetCurrentReadDrawableFn = Debug_glXGetCurrentReadDrawable;
875 }
876 if (!debug_fn.glXGetFBConfigAttribFn) {
877 debug_fn.glXGetFBConfigAttribFn = fn.glXGetFBConfigAttribFn;
878 fn.glXGetFBConfigAttribFn = Debug_glXGetFBConfigAttrib;
879 }
880 if (!debug_fn.glXGetFBConfigFromVisualSGIXFn) {
881 debug_fn.glXGetFBConfigFromVisualSGIXFn = fn.glXGetFBConfigFromVisualSGIXFn;
882 fn.glXGetFBConfigFromVisualSGIXFn = Debug_glXGetFBConfigFromVisualSGIX;
883 }
884 if (!debug_fn.glXGetFBConfigsFn) {
885 debug_fn.glXGetFBConfigsFn = fn.glXGetFBConfigsFn;
886 fn.glXGetFBConfigsFn = Debug_glXGetFBConfigs;
887 }
888 if (!debug_fn.glXGetMscRateOMLFn) {
889 debug_fn.glXGetMscRateOMLFn = fn.glXGetMscRateOMLFn;
890 fn.glXGetMscRateOMLFn = Debug_glXGetMscRateOML;
891 }
892 if (!debug_fn.glXGetSelectedEventFn) {
893 debug_fn.glXGetSelectedEventFn = fn.glXGetSelectedEventFn;
894 fn.glXGetSelectedEventFn = Debug_glXGetSelectedEvent;
895 }
896 if (!debug_fn.glXGetSyncValuesOMLFn) {
897 debug_fn.glXGetSyncValuesOMLFn = fn.glXGetSyncValuesOMLFn;
898 fn.glXGetSyncValuesOMLFn = Debug_glXGetSyncValuesOML;
899 }
900 if (!debug_fn.glXGetVisualFromFBConfigFn) {
901 debug_fn.glXGetVisualFromFBConfigFn = fn.glXGetVisualFromFBConfigFn;
902 fn.glXGetVisualFromFBConfigFn = Debug_glXGetVisualFromFBConfig;
903 }
904 if (!debug_fn.glXIsDirectFn) {
905 debug_fn.glXIsDirectFn = fn.glXIsDirectFn;
906 fn.glXIsDirectFn = Debug_glXIsDirect;
907 }
908 if (!debug_fn.glXMakeContextCurrentFn) {
909 debug_fn.glXMakeContextCurrentFn = fn.glXMakeContextCurrentFn;
910 fn.glXMakeContextCurrentFn = Debug_glXMakeContextCurrent;
911 }
912 if (!debug_fn.glXMakeCurrentFn) {
913 debug_fn.glXMakeCurrentFn = fn.glXMakeCurrentFn;
914 fn.glXMakeCurrentFn = Debug_glXMakeCurrent;
915 }
916 if (!debug_fn.glXQueryContextFn) {
917 debug_fn.glXQueryContextFn = fn.glXQueryContextFn;
918 fn.glXQueryContextFn = Debug_glXQueryContext;
919 }
920 if (!debug_fn.glXQueryDrawableFn) {
921 debug_fn.glXQueryDrawableFn = fn.glXQueryDrawableFn;
922 fn.glXQueryDrawableFn = Debug_glXQueryDrawable;
923 }
924 if (!debug_fn.glXQueryExtensionFn) {
925 debug_fn.glXQueryExtensionFn = fn.glXQueryExtensionFn;
926 fn.glXQueryExtensionFn = Debug_glXQueryExtension;
927 }
928 if (!debug_fn.glXQueryExtensionsStringFn) {
929 debug_fn.glXQueryExtensionsStringFn = fn.glXQueryExtensionsStringFn;
930 fn.glXQueryExtensionsStringFn = Debug_glXQueryExtensionsString;
931 }
932 if (!debug_fn.glXQueryServerStringFn) {
933 debug_fn.glXQueryServerStringFn = fn.glXQueryServerStringFn;
934 fn.glXQueryServerStringFn = Debug_glXQueryServerString;
935 }
936 if (!debug_fn.glXQueryVersionFn) {
937 debug_fn.glXQueryVersionFn = fn.glXQueryVersionFn;
938 fn.glXQueryVersionFn = Debug_glXQueryVersion;
939 }
940 if (!debug_fn.glXReleaseTexImageEXTFn) {
941 debug_fn.glXReleaseTexImageEXTFn = fn.glXReleaseTexImageEXTFn;
942 fn.glXReleaseTexImageEXTFn = Debug_glXReleaseTexImageEXT;
943 }
944 if (!debug_fn.glXSelectEventFn) {
945 debug_fn.glXSelectEventFn = fn.glXSelectEventFn;
946 fn.glXSelectEventFn = Debug_glXSelectEvent;
947 }
948 if (!debug_fn.glXSwapBuffersFn) {
949 debug_fn.glXSwapBuffersFn = fn.glXSwapBuffersFn;
950 fn.glXSwapBuffersFn = Debug_glXSwapBuffers;
951 }
952 if (!debug_fn.glXSwapIntervalEXTFn) {
953 debug_fn.glXSwapIntervalEXTFn = fn.glXSwapIntervalEXTFn;
954 fn.glXSwapIntervalEXTFn = Debug_glXSwapIntervalEXT;
955 }
956 if (!debug_fn.glXSwapIntervalMESAFn) {
957 debug_fn.glXSwapIntervalMESAFn = fn.glXSwapIntervalMESAFn;
958 fn.glXSwapIntervalMESAFn = Debug_glXSwapIntervalMESA;
959 }
960 if (!debug_fn.glXUseXFontFn) {
961 debug_fn.glXUseXFontFn = fn.glXUseXFontFn;
962 fn.glXUseXFontFn = Debug_glXUseXFont;
963 }
964 if (!debug_fn.glXWaitGLFn) {
965 debug_fn.glXWaitGLFn = fn.glXWaitGLFn;
966 fn.glXWaitGLFn = Debug_glXWaitGL;
967 }
968 if (!debug_fn.glXWaitVideoSyncSGIFn) {
969 debug_fn.glXWaitVideoSyncSGIFn = fn.glXWaitVideoSyncSGIFn;
970 fn.glXWaitVideoSyncSGIFn = Debug_glXWaitVideoSyncSGI;
971 }
972 if (!debug_fn.glXWaitXFn) {
973 debug_fn.glXWaitXFn = fn.glXWaitXFn;
974 fn.glXWaitXFn = Debug_glXWaitX;
975 }
976 g_debugBindingsInitialized = true;
977 } 189 }
978 190
979 void DriverGLX::ClearBindings() { 191 void DriverGLX::ClearBindings() {
980 memset(this, 0, sizeof(*this)); 192 memset(this, 0, sizeof(*this));
981 } 193 }
982 194
983 void GLXApiBase::glXBindTexImageEXTFn(Display* dpy, 195 void GLXApiBase::glXBindTexImageEXTFn(Display* dpy,
984 GLXDrawable drawable, 196 GLXDrawable drawable,
985 int buffer, 197 int buffer,
986 int* attribList) { 198 int* attribList) {
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 unsigned int* count) { 778 unsigned int* count) {
1567 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI") 779 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI")
1568 return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count); 780 return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count);
1569 } 781 }
1570 782
1571 void TraceGLXApi::glXWaitXFn(void) { 783 void TraceGLXApi::glXWaitXFn(void) {
1572 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX") 784 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX")
1573 glx_api_->glXWaitXFn(); 785 glx_api_->glXWaitXFn();
1574 } 786 }
1575 787
788 void DebugGLXApi::glXBindTexImageEXTFn(Display* dpy,
789 GLXDrawable drawable,
790 int buffer,
791 int* attribList) {
792 GL_SERVICE_LOG("glXBindTexImageEXT"
793 << "(" << static_cast<const void*>(dpy) << ", " << drawable
794 << ", " << buffer << ", "
795 << static_cast<const void*>(attribList) << ")");
796 glx_api_->glXBindTexImageEXTFn(dpy, drawable, buffer, attribList);
797 }
798
799 GLXFBConfig* DebugGLXApi::glXChooseFBConfigFn(Display* dpy,
800 int screen,
801 const int* attribList,
802 int* nitems) {
803 GL_SERVICE_LOG("glXChooseFBConfig"
804 << "(" << static_cast<const void*>(dpy) << ", " << screen
805 << ", " << static_cast<const void*>(attribList) << ", "
806 << static_cast<const void*>(nitems) << ")");
807 GLXFBConfig* result =
808 glx_api_->glXChooseFBConfigFn(dpy, screen, attribList, nitems);
809 GL_SERVICE_LOG("GL_RESULT: " << result);
810 return result;
811 }
812
813 XVisualInfo* DebugGLXApi::glXChooseVisualFn(Display* dpy,
814 int screen,
815 int* attribList) {
816 GL_SERVICE_LOG("glXChooseVisual"
817 << "(" << static_cast<const void*>(dpy) << ", " << screen
818 << ", " << static_cast<const void*>(attribList) << ")");
819 XVisualInfo* result = glx_api_->glXChooseVisualFn(dpy, screen, attribList);
820 GL_SERVICE_LOG("GL_RESULT: " << result);
821 return result;
822 }
823
824 void DebugGLXApi::glXCopyContextFn(Display* dpy,
825 GLXContext src,
826 GLXContext dst,
827 unsigned long mask) {
828 GL_SERVICE_LOG("glXCopyContext"
829 << "(" << static_cast<const void*>(dpy) << ", " << src << ", "
830 << dst << ", " << mask << ")");
831 glx_api_->glXCopyContextFn(dpy, src, dst, mask);
832 }
833
834 void DebugGLXApi::glXCopySubBufferMESAFn(Display* dpy,
835 GLXDrawable drawable,
836 int x,
837 int y,
838 int width,
839 int height) {
840 GL_SERVICE_LOG("glXCopySubBufferMESA"
841 << "(" << static_cast<const void*>(dpy) << ", " << drawable
842 << ", " << x << ", " << y << ", " << width << ", " << height
843 << ")");
844 glx_api_->glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height);
845 }
846
847 GLXContext DebugGLXApi::glXCreateContextFn(Display* dpy,
848 XVisualInfo* vis,
849 GLXContext shareList,
850 int direct) {
851 GL_SERVICE_LOG("glXCreateContext"
852 << "(" << static_cast<const void*>(dpy) << ", "
853 << static_cast<const void*>(vis) << ", " << shareList << ", "
854 << direct << ")");
855 GLXContext result = glx_api_->glXCreateContextFn(dpy, vis, shareList, direct);
856 GL_SERVICE_LOG("GL_RESULT: " << result);
857 return result;
858 }
859
860 GLXContext DebugGLXApi::glXCreateContextAttribsARBFn(Display* dpy,
861 GLXFBConfig config,
862 GLXContext share_context,
863 int direct,
864 const int* attrib_list) {
865 GL_SERVICE_LOG("glXCreateContextAttribsARB"
866 << "(" << static_cast<const void*>(dpy) << ", " << config
867 << ", " << share_context << ", " << direct << ", "
868 << static_cast<const void*>(attrib_list) << ")");
869 GLXContext result = glx_api_->glXCreateContextAttribsARBFn(
870 dpy, config, share_context, direct, attrib_list);
871 GL_SERVICE_LOG("GL_RESULT: " << result);
872 return result;
873 }
874
875 GLXPixmap DebugGLXApi::glXCreateGLXPixmapFn(Display* dpy,
876 XVisualInfo* visual,
877 Pixmap pixmap) {
878 GL_SERVICE_LOG("glXCreateGLXPixmap"
879 << "(" << static_cast<const void*>(dpy) << ", "
880 << static_cast<const void*>(visual) << ", " << pixmap << ")");
881 GLXPixmap result = glx_api_->glXCreateGLXPixmapFn(dpy, visual, pixmap);
882 GL_SERVICE_LOG("GL_RESULT: " << result);
883 return result;
884 }
885
886 GLXContext DebugGLXApi::glXCreateNewContextFn(Display* dpy,
887 GLXFBConfig config,
888 int renderType,
889 GLXContext shareList,
890 int direct) {
891 GL_SERVICE_LOG("glXCreateNewContext"
892 << "(" << static_cast<const void*>(dpy) << ", " << config
893 << ", " << renderType << ", " << shareList << ", " << direct
894 << ")");
895 GLXContext result = glx_api_->glXCreateNewContextFn(dpy, config, renderType,
896 shareList, direct);
897 GL_SERVICE_LOG("GL_RESULT: " << result);
898 return result;
899 }
900
901 GLXPbuffer DebugGLXApi::glXCreatePbufferFn(Display* dpy,
902 GLXFBConfig config,
903 const int* attribList) {
904 GL_SERVICE_LOG("glXCreatePbuffer"
905 << "(" << static_cast<const void*>(dpy) << ", " << config
906 << ", " << static_cast<const void*>(attribList) << ")");
907 GLXPbuffer result = glx_api_->glXCreatePbufferFn(dpy, config, attribList);
908 GL_SERVICE_LOG("GL_RESULT: " << result);
909 return result;
910 }
911
912 GLXPixmap DebugGLXApi::glXCreatePixmapFn(Display* dpy,
913 GLXFBConfig config,
914 Pixmap pixmap,
915 const int* attribList) {
916 GL_SERVICE_LOG("glXCreatePixmap"
917 << "(" << static_cast<const void*>(dpy) << ", " << config
918 << ", " << pixmap << ", "
919 << static_cast<const void*>(attribList) << ")");
920 GLXPixmap result =
921 glx_api_->glXCreatePixmapFn(dpy, config, pixmap, attribList);
922 GL_SERVICE_LOG("GL_RESULT: " << result);
923 return result;
924 }
925
926 GLXWindow DebugGLXApi::glXCreateWindowFn(Display* dpy,
927 GLXFBConfig config,
928 Window win,
929 const int* attribList) {
930 GL_SERVICE_LOG("glXCreateWindow"
931 << "(" << static_cast<const void*>(dpy) << ", " << config
932 << ", " << win << ", " << static_cast<const void*>(attribList)
933 << ")");
934 GLXWindow result = glx_api_->glXCreateWindowFn(dpy, config, win, attribList);
935 GL_SERVICE_LOG("GL_RESULT: " << result);
936 return result;
937 }
938
939 void DebugGLXApi::glXDestroyContextFn(Display* dpy, GLXContext ctx) {
940 GL_SERVICE_LOG("glXDestroyContext"
941 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
942 glx_api_->glXDestroyContextFn(dpy, ctx);
943 }
944
945 void DebugGLXApi::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) {
946 GL_SERVICE_LOG("glXDestroyGLXPixmap"
947 << "(" << static_cast<const void*>(dpy) << ", " << pixmap
948 << ")");
949 glx_api_->glXDestroyGLXPixmapFn(dpy, pixmap);
950 }
951
952 void DebugGLXApi::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) {
953 GL_SERVICE_LOG("glXDestroyPbuffer"
954 << "(" << static_cast<const void*>(dpy) << ", " << pbuf
955 << ")");
956 glx_api_->glXDestroyPbufferFn(dpy, pbuf);
957 }
958
959 void DebugGLXApi::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) {
960 GL_SERVICE_LOG("glXDestroyPixmap"
961 << "(" << static_cast<const void*>(dpy) << ", " << pixmap
962 << ")");
963 glx_api_->glXDestroyPixmapFn(dpy, pixmap);
964 }
965
966 void DebugGLXApi::glXDestroyWindowFn(Display* dpy, GLXWindow window) {
967 GL_SERVICE_LOG("glXDestroyWindow"
968 << "(" << static_cast<const void*>(dpy) << ", " << window
969 << ")");
970 glx_api_->glXDestroyWindowFn(dpy, window);
971 }
972
973 const char* DebugGLXApi::glXGetClientStringFn(Display* dpy, int name) {
974 GL_SERVICE_LOG("glXGetClientString"
975 << "(" << static_cast<const void*>(dpy) << ", " << name
976 << ")");
977 const char* result = glx_api_->glXGetClientStringFn(dpy, name);
978 GL_SERVICE_LOG("GL_RESULT: " << result);
979 return result;
980 }
981
982 int DebugGLXApi::glXGetConfigFn(Display* dpy,
983 XVisualInfo* visual,
984 int attrib,
985 int* value) {
986 GL_SERVICE_LOG("glXGetConfig"
987 << "(" << static_cast<const void*>(dpy) << ", "
988 << static_cast<const void*>(visual) << ", " << attrib << ", "
989 << static_cast<const void*>(value) << ")");
990 int result = glx_api_->glXGetConfigFn(dpy, visual, attrib, value);
991 GL_SERVICE_LOG("GL_RESULT: " << result);
992 return result;
993 }
994
995 GLXContext DebugGLXApi::glXGetCurrentContextFn(void) {
996 GL_SERVICE_LOG("glXGetCurrentContext"
997 << "("
998 << ")");
999 GLXContext result = glx_api_->glXGetCurrentContextFn();
1000 GL_SERVICE_LOG("GL_RESULT: " << result);
1001 return result;
1002 }
1003
1004 Display* DebugGLXApi::glXGetCurrentDisplayFn(void) {
1005 GL_SERVICE_LOG("glXGetCurrentDisplay"
1006 << "("
1007 << ")");
1008 Display* result = glx_api_->glXGetCurrentDisplayFn();
1009 GL_SERVICE_LOG("GL_RESULT: " << result);
1010 return result;
1011 }
1012
1013 GLXDrawable DebugGLXApi::glXGetCurrentDrawableFn(void) {
1014 GL_SERVICE_LOG("glXGetCurrentDrawable"
1015 << "("
1016 << ")");
1017 GLXDrawable result = glx_api_->glXGetCurrentDrawableFn();
1018 GL_SERVICE_LOG("GL_RESULT: " << result);
1019 return result;
1020 }
1021
1022 GLXDrawable DebugGLXApi::glXGetCurrentReadDrawableFn(void) {
1023 GL_SERVICE_LOG("glXGetCurrentReadDrawable"
1024 << "("
1025 << ")");
1026 GLXDrawable result = glx_api_->glXGetCurrentReadDrawableFn();
1027 GL_SERVICE_LOG("GL_RESULT: " << result);
1028 return result;
1029 }
1030
1031 int DebugGLXApi::glXGetFBConfigAttribFn(Display* dpy,
1032 GLXFBConfig config,
1033 int attribute,
1034 int* value) {
1035 GL_SERVICE_LOG("glXGetFBConfigAttrib"
1036 << "(" << static_cast<const void*>(dpy) << ", " << config
1037 << ", " << attribute << ", " << static_cast<const void*>(value)
1038 << ")");
1039 int result = glx_api_->glXGetFBConfigAttribFn(dpy, config, attribute, value);
1040 GL_SERVICE_LOG("GL_RESULT: " << result);
1041 return result;
1042 }
1043
1044 GLXFBConfig DebugGLXApi::glXGetFBConfigFromVisualSGIXFn(
1045 Display* dpy,
1046 XVisualInfo* visualInfo) {
1047 GL_SERVICE_LOG("glXGetFBConfigFromVisualSGIX"
1048 << "(" << static_cast<const void*>(dpy) << ", "
1049 << static_cast<const void*>(visualInfo) << ")");
1050 GLXFBConfig result =
1051 glx_api_->glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo);
1052 GL_SERVICE_LOG("GL_RESULT: " << result);
1053 return result;
1054 }
1055
1056 GLXFBConfig* DebugGLXApi::glXGetFBConfigsFn(Display* dpy,
1057 int screen,
1058 int* nelements) {
1059 GL_SERVICE_LOG("glXGetFBConfigs"
1060 << "(" << static_cast<const void*>(dpy) << ", " << screen
1061 << ", " << static_cast<const void*>(nelements) << ")");
1062 GLXFBConfig* result = glx_api_->glXGetFBConfigsFn(dpy, screen, nelements);
1063 GL_SERVICE_LOG("GL_RESULT: " << result);
1064 return result;
1065 }
1066
1067 bool DebugGLXApi::glXGetMscRateOMLFn(Display* dpy,
1068 GLXDrawable drawable,
1069 int32_t* numerator,
1070 int32_t* denominator) {
1071 GL_SERVICE_LOG("glXGetMscRateOML"
1072 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1073 << ", " << static_cast<const void*>(numerator) << ", "
1074 << static_cast<const void*>(denominator) << ")");
1075 bool result =
1076 glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
1077 GL_SERVICE_LOG("GL_RESULT: " << result);
1078 return result;
1079 }
1080
1081 void DebugGLXApi::glXGetSelectedEventFn(Display* dpy,
1082 GLXDrawable drawable,
1083 unsigned long* mask) {
1084 GL_SERVICE_LOG("glXGetSelectedEvent"
1085 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1086 << ", " << static_cast<const void*>(mask) << ")");
1087 glx_api_->glXGetSelectedEventFn(dpy, drawable, mask);
1088 }
1089
1090 bool DebugGLXApi::glXGetSyncValuesOMLFn(Display* dpy,
1091 GLXDrawable drawable,
1092 int64_t* ust,
1093 int64_t* msc,
1094 int64_t* sbc) {
1095 GL_SERVICE_LOG("glXGetSyncValuesOML"
1096 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1097 << ", " << static_cast<const void*>(ust) << ", "
1098 << static_cast<const void*>(msc) << ", "
1099 << static_cast<const void*>(sbc) << ")");
1100 bool result = glx_api_->glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc);
1101 GL_SERVICE_LOG("GL_RESULT: " << result);
1102 return result;
1103 }
1104
1105 XVisualInfo* DebugGLXApi::glXGetVisualFromFBConfigFn(Display* dpy,
1106 GLXFBConfig config) {
1107 GL_SERVICE_LOG("glXGetVisualFromFBConfig"
1108 << "(" << static_cast<const void*>(dpy) << ", " << config
1109 << ")");
1110 XVisualInfo* result = glx_api_->glXGetVisualFromFBConfigFn(dpy, config);
1111 GL_SERVICE_LOG("GL_RESULT: " << result);
1112 return result;
1113 }
1114
1115 int DebugGLXApi::glXIsDirectFn(Display* dpy, GLXContext ctx) {
1116 GL_SERVICE_LOG("glXIsDirect"
1117 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
1118 int result = glx_api_->glXIsDirectFn(dpy, ctx);
1119 GL_SERVICE_LOG("GL_RESULT: " << result);
1120 return result;
1121 }
1122
1123 int DebugGLXApi::glXMakeContextCurrentFn(Display* dpy,
1124 GLXDrawable draw,
1125 GLXDrawable read,
1126 GLXContext ctx) {
1127 GL_SERVICE_LOG("glXMakeContextCurrent"
1128 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
1129 << read << ", " << ctx << ")");
1130 int result = glx_api_->glXMakeContextCurrentFn(dpy, draw, read, ctx);
1131 GL_SERVICE_LOG("GL_RESULT: " << result);
1132 return result;
1133 }
1134
1135 int DebugGLXApi::glXMakeCurrentFn(Display* dpy,
1136 GLXDrawable drawable,
1137 GLXContext ctx) {
1138 GL_SERVICE_LOG("glXMakeCurrent"
1139 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1140 << ", " << ctx << ")");
1141 int result = glx_api_->glXMakeCurrentFn(dpy, drawable, ctx);
1142 GL_SERVICE_LOG("GL_RESULT: " << result);
1143 return result;
1144 }
1145
1146 int DebugGLXApi::glXQueryContextFn(Display* dpy,
1147 GLXContext ctx,
1148 int attribute,
1149 int* value) {
1150 GL_SERVICE_LOG("glXQueryContext"
1151 << "(" << static_cast<const void*>(dpy) << ", " << ctx << ", "
1152 << attribute << ", " << static_cast<const void*>(value)
1153 << ")");
1154 int result = glx_api_->glXQueryContextFn(dpy, ctx, attribute, value);
1155 GL_SERVICE_LOG("GL_RESULT: " << result);
1156 return result;
1157 }
1158
1159 void DebugGLXApi::glXQueryDrawableFn(Display* dpy,
1160 GLXDrawable draw,
1161 int attribute,
1162 unsigned int* value) {
1163 GL_SERVICE_LOG("glXQueryDrawable"
1164 << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
1165 << attribute << ", " << static_cast<const void*>(value)
1166 << ")");
1167 glx_api_->glXQueryDrawableFn(dpy, draw, attribute, value);
1168 }
1169
1170 int DebugGLXApi::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) {
1171 GL_SERVICE_LOG("glXQueryExtension"
1172 << "(" << static_cast<const void*>(dpy) << ", "
1173 << static_cast<const void*>(errorb) << ", "
1174 << static_cast<const void*>(event) << ")");
1175 int result = glx_api_->glXQueryExtensionFn(dpy, errorb, event);
1176 GL_SERVICE_LOG("GL_RESULT: " << result);
1177 return result;
1178 }
1179
1180 const char* DebugGLXApi::glXQueryExtensionsStringFn(Display* dpy, int screen) {
1181 GL_SERVICE_LOG("glXQueryExtensionsString"
1182 << "(" << static_cast<const void*>(dpy) << ", " << screen
1183 << ")");
1184 const char* result = glx_api_->glXQueryExtensionsStringFn(dpy, screen);
1185 GL_SERVICE_LOG("GL_RESULT: " << result);
1186 return result;
1187 }
1188
1189 const char* DebugGLXApi::glXQueryServerStringFn(Display* dpy,
1190 int screen,
1191 int name) {
1192 GL_SERVICE_LOG("glXQueryServerString"
1193 << "(" << static_cast<const void*>(dpy) << ", " << screen
1194 << ", " << name << ")");
1195 const char* result = glx_api_->glXQueryServerStringFn(dpy, screen, name);
1196 GL_SERVICE_LOG("GL_RESULT: " << result);
1197 return result;
1198 }
1199
1200 int DebugGLXApi::glXQueryVersionFn(Display* dpy, int* maj, int* min) {
1201 GL_SERVICE_LOG("glXQueryVersion"
1202 << "(" << static_cast<const void*>(dpy) << ", "
1203 << static_cast<const void*>(maj) << ", "
1204 << static_cast<const void*>(min) << ")");
1205 int result = glx_api_->glXQueryVersionFn(dpy, maj, min);
1206 GL_SERVICE_LOG("GL_RESULT: " << result);
1207 return result;
1208 }
1209
1210 void DebugGLXApi::glXReleaseTexImageEXTFn(Display* dpy,
1211 GLXDrawable drawable,
1212 int buffer) {
1213 GL_SERVICE_LOG("glXReleaseTexImageEXT"
1214 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1215 << ", " << buffer << ")");
1216 glx_api_->glXReleaseTexImageEXTFn(dpy, drawable, buffer);
1217 }
1218
1219 void DebugGLXApi::glXSelectEventFn(Display* dpy,
1220 GLXDrawable drawable,
1221 unsigned long mask) {
1222 GL_SERVICE_LOG("glXSelectEvent"
1223 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1224 << ", " << mask << ")");
1225 glx_api_->glXSelectEventFn(dpy, drawable, mask);
1226 }
1227
1228 void DebugGLXApi::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) {
1229 GL_SERVICE_LOG("glXSwapBuffers"
1230 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1231 << ")");
1232 glx_api_->glXSwapBuffersFn(dpy, drawable);
1233 }
1234
1235 void DebugGLXApi::glXSwapIntervalEXTFn(Display* dpy,
1236 GLXDrawable drawable,
1237 int interval) {
1238 GL_SERVICE_LOG("glXSwapIntervalEXT"
1239 << "(" << static_cast<const void*>(dpy) << ", " << drawable
1240 << ", " << interval << ")");
1241 glx_api_->glXSwapIntervalEXTFn(dpy, drawable, interval);
1242 }
1243
1244 void DebugGLXApi::glXSwapIntervalMESAFn(unsigned int interval) {
1245 GL_SERVICE_LOG("glXSwapIntervalMESA"
1246 << "(" << interval << ")");
1247 glx_api_->glXSwapIntervalMESAFn(interval);
1248 }
1249
1250 void DebugGLXApi::glXUseXFontFn(Font font, int first, int count, int list) {
1251 GL_SERVICE_LOG("glXUseXFont"
1252 << "(" << font << ", " << first << ", " << count << ", "
1253 << list << ")");
1254 glx_api_->glXUseXFontFn(font, first, count, list);
1255 }
1256
1257 void DebugGLXApi::glXWaitGLFn(void) {
1258 GL_SERVICE_LOG("glXWaitGL"
1259 << "("
1260 << ")");
1261 glx_api_->glXWaitGLFn();
1262 }
1263
1264 int DebugGLXApi::glXWaitVideoSyncSGIFn(int divisor,
1265 int remainder,
1266 unsigned int* count) {
1267 GL_SERVICE_LOG("glXWaitVideoSyncSGI"
1268 << "(" << divisor << ", " << remainder << ", "
1269 << static_cast<const void*>(count) << ")");
1270 int result = glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count);
1271 GL_SERVICE_LOG("GL_RESULT: " << result);
1272 return result;
1273 }
1274
1275 void DebugGLXApi::glXWaitXFn(void) {
1276 GL_SERVICE_LOG("glXWaitX"
1277 << "("
1278 << ")");
1279 glx_api_->glXWaitXFn();
1280 }
1281
1576 } // namespace gl 1282 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_gl4.cc ('k') | ui/gl/gl_bindings_autogen_osmesa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698