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

Side by Side Diff: ui/gl/gl_bindings_autogen_wgl.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_osmesa.cc ('k') | ui/gl/gl_context.h » ('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_implementation.h" 17 #include "ui/gl/gl_implementation.h"
18 #include "ui/gl/gl_version_info.h" 18 #include "ui/gl/gl_version_info.h"
19 #include "ui/gl/gl_wgl_api_implementation.h" 19 #include "ui/gl/gl_wgl_api_implementation.h"
20 20
21 namespace gl { 21 namespace gl {
22 22
23 static bool g_debugBindingsInitialized;
24 DriverWGL g_driver_wgl; 23 DriverWGL g_driver_wgl;
25 24
26 void DriverWGL::InitializeStaticBindings() { 25 void DriverWGL::InitializeStaticBindings() {
27 fn.wglChoosePixelFormatARBFn = 0; 26 fn.wglChoosePixelFormatARBFn = 0;
28 fn.wglCopyContextFn = 27 fn.wglCopyContextFn =
29 reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext")); 28 reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext"));
30 fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>( 29 fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>(
31 GetGLProcAddress("wglCreateContext")); 30 GetGLProcAddress("wglCreateContext"));
32 fn.wglCreateContextAttribsARBFn = 0; 31 fn.wglCreateContextAttribsARBFn = 0;
33 fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>( 32 fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 extensions.find("WGL_ARB_extensions_string ") != std::string::npos; 68 extensions.find("WGL_ARB_extensions_string ") != std::string::npos;
70 ext.b_WGL_ARB_pbuffer = 69 ext.b_WGL_ARB_pbuffer =
71 extensions.find("WGL_ARB_pbuffer ") != std::string::npos; 70 extensions.find("WGL_ARB_pbuffer ") != std::string::npos;
72 ext.b_WGL_ARB_pixel_format = 71 ext.b_WGL_ARB_pixel_format =
73 extensions.find("WGL_ARB_pixel_format ") != std::string::npos; 72 extensions.find("WGL_ARB_pixel_format ") != std::string::npos;
74 ext.b_WGL_EXT_extensions_string = 73 ext.b_WGL_EXT_extensions_string =
75 extensions.find("WGL_EXT_extensions_string ") != std::string::npos; 74 extensions.find("WGL_EXT_extensions_string ") != std::string::npos;
76 ext.b_WGL_EXT_swap_control = 75 ext.b_WGL_EXT_swap_control =
77 extensions.find("WGL_EXT_swap_control ") != std::string::npos; 76 extensions.find("WGL_EXT_swap_control ") != std::string::npos;
78 77
79 debug_fn.wglChoosePixelFormatARBFn = 0;
80 if (ext.b_WGL_ARB_pixel_format) { 78 if (ext.b_WGL_ARB_pixel_format) {
81 fn.wglChoosePixelFormatARBFn = 79 fn.wglChoosePixelFormatARBFn =
82 reinterpret_cast<wglChoosePixelFormatARBProc>( 80 reinterpret_cast<wglChoosePixelFormatARBProc>(
83 GetGLProcAddress("wglChoosePixelFormatARB")); 81 GetGLProcAddress("wglChoosePixelFormatARB"));
84 } 82 }
85 83
86 debug_fn.wglCreateContextAttribsARBFn = 0;
87 if (ext.b_WGL_ARB_create_context) { 84 if (ext.b_WGL_ARB_create_context) {
88 fn.wglCreateContextAttribsARBFn = 85 fn.wglCreateContextAttribsARBFn =
89 reinterpret_cast<wglCreateContextAttribsARBProc>( 86 reinterpret_cast<wglCreateContextAttribsARBProc>(
90 GetGLProcAddress("wglCreateContextAttribsARB")); 87 GetGLProcAddress("wglCreateContextAttribsARB"));
91 } 88 }
92 89
93 debug_fn.wglCreatePbufferARBFn = 0;
94 if (ext.b_WGL_ARB_pbuffer) { 90 if (ext.b_WGL_ARB_pbuffer) {
95 fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>( 91 fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>(
96 GetGLProcAddress("wglCreatePbufferARB")); 92 GetGLProcAddress("wglCreatePbufferARB"));
97 } 93 }
98 94
99 debug_fn.wglDestroyPbufferARBFn = 0;
100 if (ext.b_WGL_ARB_pbuffer) { 95 if (ext.b_WGL_ARB_pbuffer) {
101 fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>( 96 fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>(
102 GetGLProcAddress("wglDestroyPbufferARB")); 97 GetGLProcAddress("wglDestroyPbufferARB"));
103 } 98 }
104 99
105 debug_fn.wglGetPbufferDCARBFn = 0;
106 if (ext.b_WGL_ARB_pbuffer) { 100 if (ext.b_WGL_ARB_pbuffer) {
107 fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>( 101 fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>(
108 GetGLProcAddress("wglGetPbufferDCARB")); 102 GetGLProcAddress("wglGetPbufferDCARB"));
109 } 103 }
110 104
111 debug_fn.wglQueryPbufferARBFn = 0;
112 if (ext.b_WGL_ARB_pbuffer) { 105 if (ext.b_WGL_ARB_pbuffer) {
113 fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>( 106 fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>(
114 GetGLProcAddress("wglQueryPbufferARB")); 107 GetGLProcAddress("wglQueryPbufferARB"));
115 } 108 }
116 109
117 debug_fn.wglReleasePbufferDCARBFn = 0;
118 if (ext.b_WGL_ARB_pbuffer) { 110 if (ext.b_WGL_ARB_pbuffer) {
119 fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>( 111 fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>(
120 GetGLProcAddress("wglReleasePbufferDCARB")); 112 GetGLProcAddress("wglReleasePbufferDCARB"));
121 } 113 }
122 114
123 debug_fn.wglSwapIntervalEXTFn = 0;
124 if (ext.b_WGL_EXT_swap_control) { 115 if (ext.b_WGL_EXT_swap_control) {
125 fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>( 116 fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>(
126 GetGLProcAddress("wglSwapIntervalEXT")); 117 GetGLProcAddress("wglSwapIntervalEXT"));
127 } 118 }
128
129 if (g_debugBindingsInitialized)
130 InitializeDebugBindings();
131 }
132
133 extern "C" {
134
135 static BOOL GL_BINDING_CALL
136 Debug_wglChoosePixelFormatARB(HDC dc,
137 const int* int_attrib_list,
138 const float* float_attrib_list,
139 UINT max_formats,
140 int* formats,
141 UINT* num_formats) {
142 GL_SERVICE_LOG("wglChoosePixelFormatARB"
143 << "(" << dc << ", "
144 << static_cast<const void*>(int_attrib_list) << ", "
145 << static_cast<const void*>(float_attrib_list) << ", "
146 << max_formats << ", " << static_cast<const void*>(formats)
147 << ", " << static_cast<const void*>(num_formats) << ")");
148 DCHECK(g_driver_wgl.debug_fn.wglChoosePixelFormatARBFn != nullptr);
149 BOOL result = g_driver_wgl.debug_fn.wglChoosePixelFormatARBFn(
150 dc, int_attrib_list, float_attrib_list, max_formats, formats,
151 num_formats);
152 GL_SERVICE_LOG("GL_RESULT: " << result);
153 return result;
154 }
155
156 static BOOL GL_BINDING_CALL Debug_wglCopyContext(HGLRC hglrcSrc,
157 HGLRC hglrcDst,
158 UINT mask) {
159 GL_SERVICE_LOG("wglCopyContext"
160 << "(" << hglrcSrc << ", " << hglrcDst << ", " << mask << ")");
161 DCHECK(g_driver_wgl.debug_fn.wglCopyContextFn != nullptr);
162 BOOL result =
163 g_driver_wgl.debug_fn.wglCopyContextFn(hglrcSrc, hglrcDst, mask);
164 GL_SERVICE_LOG("GL_RESULT: " << result);
165 return result;
166 }
167
168 static HGLRC GL_BINDING_CALL Debug_wglCreateContext(HDC hdc) {
169 GL_SERVICE_LOG("wglCreateContext"
170 << "(" << hdc << ")");
171 DCHECK(g_driver_wgl.debug_fn.wglCreateContextFn != nullptr);
172 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextFn(hdc);
173 GL_SERVICE_LOG("GL_RESULT: " << result);
174 return result;
175 }
176
177 static HGLRC GL_BINDING_CALL
178 Debug_wglCreateContextAttribsARB(HDC hDC,
179 HGLRC hShareContext,
180 const int* attribList) {
181 GL_SERVICE_LOG("wglCreateContextAttribsARB"
182 << "(" << hDC << ", " << hShareContext << ", "
183 << static_cast<const void*>(attribList) << ")");
184 DCHECK(g_driver_wgl.debug_fn.wglCreateContextAttribsARBFn != nullptr);
185 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextAttribsARBFn(
186 hDC, hShareContext, attribList);
187 GL_SERVICE_LOG("GL_RESULT: " << result);
188 return result;
189 }
190
191 static HGLRC GL_BINDING_CALL Debug_wglCreateLayerContext(HDC hdc,
192 int iLayerPlane) {
193 GL_SERVICE_LOG("wglCreateLayerContext"
194 << "(" << hdc << ", " << iLayerPlane << ")");
195 DCHECK(g_driver_wgl.debug_fn.wglCreateLayerContextFn != nullptr);
196 HGLRC result =
197 g_driver_wgl.debug_fn.wglCreateLayerContextFn(hdc, iLayerPlane);
198 GL_SERVICE_LOG("GL_RESULT: " << result);
199 return result;
200 }
201
202 static HPBUFFERARB GL_BINDING_CALL
203 Debug_wglCreatePbufferARB(HDC hDC,
204 int iPixelFormat,
205 int iWidth,
206 int iHeight,
207 const int* piAttribList) {
208 GL_SERVICE_LOG("wglCreatePbufferARB"
209 << "(" << hDC << ", " << iPixelFormat << ", " << iWidth << ", "
210 << iHeight << ", " << static_cast<const void*>(piAttribList)
211 << ")");
212 DCHECK(g_driver_wgl.debug_fn.wglCreatePbufferARBFn != nullptr);
213 HPBUFFERARB result = g_driver_wgl.debug_fn.wglCreatePbufferARBFn(
214 hDC, iPixelFormat, iWidth, iHeight, piAttribList);
215 GL_SERVICE_LOG("GL_RESULT: " << result);
216 return result;
217 }
218
219 static BOOL GL_BINDING_CALL Debug_wglDeleteContext(HGLRC hglrc) {
220 GL_SERVICE_LOG("wglDeleteContext"
221 << "(" << hglrc << ")");
222 DCHECK(g_driver_wgl.debug_fn.wglDeleteContextFn != nullptr);
223 BOOL result = g_driver_wgl.debug_fn.wglDeleteContextFn(hglrc);
224 GL_SERVICE_LOG("GL_RESULT: " << result);
225 return result;
226 }
227
228 static BOOL GL_BINDING_CALL Debug_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) {
229 GL_SERVICE_LOG("wglDestroyPbufferARB"
230 << "(" << hPbuffer << ")");
231 DCHECK(g_driver_wgl.debug_fn.wglDestroyPbufferARBFn != nullptr);
232 BOOL result = g_driver_wgl.debug_fn.wglDestroyPbufferARBFn(hPbuffer);
233 GL_SERVICE_LOG("GL_RESULT: " << result);
234 return result;
235 }
236
237 static HGLRC GL_BINDING_CALL Debug_wglGetCurrentContext() {
238 GL_SERVICE_LOG("wglGetCurrentContext"
239 << "("
240 << ")");
241 DCHECK(g_driver_wgl.debug_fn.wglGetCurrentContextFn != nullptr);
242 HGLRC result = g_driver_wgl.debug_fn.wglGetCurrentContextFn();
243 GL_SERVICE_LOG("GL_RESULT: " << result);
244 return result;
245 }
246
247 static HDC GL_BINDING_CALL Debug_wglGetCurrentDC() {
248 GL_SERVICE_LOG("wglGetCurrentDC"
249 << "("
250 << ")");
251 DCHECK(g_driver_wgl.debug_fn.wglGetCurrentDCFn != nullptr);
252 HDC result = g_driver_wgl.debug_fn.wglGetCurrentDCFn();
253 GL_SERVICE_LOG("GL_RESULT: " << result);
254 return result;
255 }
256
257 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringARB(HDC hDC) {
258 GL_SERVICE_LOG("wglGetExtensionsStringARB"
259 << "(" << hDC << ")");
260 DCHECK(g_driver_wgl.debug_fn.wglGetExtensionsStringARBFn != nullptr);
261 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringARBFn(hDC);
262 GL_SERVICE_LOG("GL_RESULT: " << result);
263 return result;
264 }
265
266 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringEXT() {
267 GL_SERVICE_LOG("wglGetExtensionsStringEXT"
268 << "("
269 << ")");
270 DCHECK(g_driver_wgl.debug_fn.wglGetExtensionsStringEXTFn != nullptr);
271 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringEXTFn();
272 GL_SERVICE_LOG("GL_RESULT: " << result);
273 return result;
274 }
275
276 static HDC GL_BINDING_CALL Debug_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) {
277 GL_SERVICE_LOG("wglGetPbufferDCARB"
278 << "(" << hPbuffer << ")");
279 DCHECK(g_driver_wgl.debug_fn.wglGetPbufferDCARBFn != nullptr);
280 HDC result = g_driver_wgl.debug_fn.wglGetPbufferDCARBFn(hPbuffer);
281 GL_SERVICE_LOG("GL_RESULT: " << result);
282 return result;
283 }
284
285 static BOOL GL_BINDING_CALL Debug_wglMakeCurrent(HDC hdc, HGLRC hglrc) {
286 GL_SERVICE_LOG("wglMakeCurrent"
287 << "(" << hdc << ", " << hglrc << ")");
288 DCHECK(g_driver_wgl.debug_fn.wglMakeCurrentFn != nullptr);
289 BOOL result = g_driver_wgl.debug_fn.wglMakeCurrentFn(hdc, hglrc);
290 GL_SERVICE_LOG("GL_RESULT: " << result);
291 return result;
292 }
293
294 static BOOL GL_BINDING_CALL Debug_wglQueryPbufferARB(HPBUFFERARB hPbuffer,
295 int iAttribute,
296 int* piValue) {
297 GL_SERVICE_LOG("wglQueryPbufferARB"
298 << "(" << hPbuffer << ", " << iAttribute << ", "
299 << static_cast<const void*>(piValue) << ")");
300 DCHECK(g_driver_wgl.debug_fn.wglQueryPbufferARBFn != nullptr);
301 BOOL result =
302 g_driver_wgl.debug_fn.wglQueryPbufferARBFn(hPbuffer, iAttribute, piValue);
303 GL_SERVICE_LOG("GL_RESULT: " << result);
304 return result;
305 }
306
307 static int GL_BINDING_CALL Debug_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer,
308 HDC hDC) {
309 GL_SERVICE_LOG("wglReleasePbufferDCARB"
310 << "(" << hPbuffer << ", " << hDC << ")");
311 DCHECK(g_driver_wgl.debug_fn.wglReleasePbufferDCARBFn != nullptr);
312 int result = g_driver_wgl.debug_fn.wglReleasePbufferDCARBFn(hPbuffer, hDC);
313 GL_SERVICE_LOG("GL_RESULT: " << result);
314 return result;
315 }
316
317 static BOOL GL_BINDING_CALL Debug_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
318 GL_SERVICE_LOG("wglShareLists"
319 << "(" << hglrc1 << ", " << hglrc2 << ")");
320 DCHECK(g_driver_wgl.debug_fn.wglShareListsFn != nullptr);
321 BOOL result = g_driver_wgl.debug_fn.wglShareListsFn(hglrc1, hglrc2);
322 GL_SERVICE_LOG("GL_RESULT: " << result);
323 return result;
324 }
325
326 static BOOL GL_BINDING_CALL Debug_wglSwapIntervalEXT(int interval) {
327 GL_SERVICE_LOG("wglSwapIntervalEXT"
328 << "(" << interval << ")");
329 DCHECK(g_driver_wgl.debug_fn.wglSwapIntervalEXTFn != nullptr);
330 BOOL result = g_driver_wgl.debug_fn.wglSwapIntervalEXTFn(interval);
331 GL_SERVICE_LOG("GL_RESULT: " << result);
332 return result;
333 }
334
335 static BOOL GL_BINDING_CALL Debug_wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) {
336 GL_SERVICE_LOG("wglSwapLayerBuffers"
337 << "(" << hdc << ", " << fuPlanes << ")");
338 DCHECK(g_driver_wgl.debug_fn.wglSwapLayerBuffersFn != nullptr);
339 BOOL result = g_driver_wgl.debug_fn.wglSwapLayerBuffersFn(hdc, fuPlanes);
340 GL_SERVICE_LOG("GL_RESULT: " << result);
341 return result;
342 }
343 } // extern "C"
344
345 void DriverWGL::InitializeDebugBindings() {
346 if (!debug_fn.wglChoosePixelFormatARBFn) {
347 debug_fn.wglChoosePixelFormatARBFn = fn.wglChoosePixelFormatARBFn;
348 fn.wglChoosePixelFormatARBFn = Debug_wglChoosePixelFormatARB;
349 }
350 if (!debug_fn.wglCopyContextFn) {
351 debug_fn.wglCopyContextFn = fn.wglCopyContextFn;
352 fn.wglCopyContextFn = Debug_wglCopyContext;
353 }
354 if (!debug_fn.wglCreateContextFn) {
355 debug_fn.wglCreateContextFn = fn.wglCreateContextFn;
356 fn.wglCreateContextFn = Debug_wglCreateContext;
357 }
358 if (!debug_fn.wglCreateContextAttribsARBFn) {
359 debug_fn.wglCreateContextAttribsARBFn = fn.wglCreateContextAttribsARBFn;
360 fn.wglCreateContextAttribsARBFn = Debug_wglCreateContextAttribsARB;
361 }
362 if (!debug_fn.wglCreateLayerContextFn) {
363 debug_fn.wglCreateLayerContextFn = fn.wglCreateLayerContextFn;
364 fn.wglCreateLayerContextFn = Debug_wglCreateLayerContext;
365 }
366 if (!debug_fn.wglCreatePbufferARBFn) {
367 debug_fn.wglCreatePbufferARBFn = fn.wglCreatePbufferARBFn;
368 fn.wglCreatePbufferARBFn = Debug_wglCreatePbufferARB;
369 }
370 if (!debug_fn.wglDeleteContextFn) {
371 debug_fn.wglDeleteContextFn = fn.wglDeleteContextFn;
372 fn.wglDeleteContextFn = Debug_wglDeleteContext;
373 }
374 if (!debug_fn.wglDestroyPbufferARBFn) {
375 debug_fn.wglDestroyPbufferARBFn = fn.wglDestroyPbufferARBFn;
376 fn.wglDestroyPbufferARBFn = Debug_wglDestroyPbufferARB;
377 }
378 if (!debug_fn.wglGetCurrentContextFn) {
379 debug_fn.wglGetCurrentContextFn = fn.wglGetCurrentContextFn;
380 fn.wglGetCurrentContextFn = Debug_wglGetCurrentContext;
381 }
382 if (!debug_fn.wglGetCurrentDCFn) {
383 debug_fn.wglGetCurrentDCFn = fn.wglGetCurrentDCFn;
384 fn.wglGetCurrentDCFn = Debug_wglGetCurrentDC;
385 }
386 if (!debug_fn.wglGetExtensionsStringARBFn) {
387 debug_fn.wglGetExtensionsStringARBFn = fn.wglGetExtensionsStringARBFn;
388 fn.wglGetExtensionsStringARBFn = Debug_wglGetExtensionsStringARB;
389 }
390 if (!debug_fn.wglGetExtensionsStringEXTFn) {
391 debug_fn.wglGetExtensionsStringEXTFn = fn.wglGetExtensionsStringEXTFn;
392 fn.wglGetExtensionsStringEXTFn = Debug_wglGetExtensionsStringEXT;
393 }
394 if (!debug_fn.wglGetPbufferDCARBFn) {
395 debug_fn.wglGetPbufferDCARBFn = fn.wglGetPbufferDCARBFn;
396 fn.wglGetPbufferDCARBFn = Debug_wglGetPbufferDCARB;
397 }
398 if (!debug_fn.wglMakeCurrentFn) {
399 debug_fn.wglMakeCurrentFn = fn.wglMakeCurrentFn;
400 fn.wglMakeCurrentFn = Debug_wglMakeCurrent;
401 }
402 if (!debug_fn.wglQueryPbufferARBFn) {
403 debug_fn.wglQueryPbufferARBFn = fn.wglQueryPbufferARBFn;
404 fn.wglQueryPbufferARBFn = Debug_wglQueryPbufferARB;
405 }
406 if (!debug_fn.wglReleasePbufferDCARBFn) {
407 debug_fn.wglReleasePbufferDCARBFn = fn.wglReleasePbufferDCARBFn;
408 fn.wglReleasePbufferDCARBFn = Debug_wglReleasePbufferDCARB;
409 }
410 if (!debug_fn.wglShareListsFn) {
411 debug_fn.wglShareListsFn = fn.wglShareListsFn;
412 fn.wglShareListsFn = Debug_wglShareLists;
413 }
414 if (!debug_fn.wglSwapIntervalEXTFn) {
415 debug_fn.wglSwapIntervalEXTFn = fn.wglSwapIntervalEXTFn;
416 fn.wglSwapIntervalEXTFn = Debug_wglSwapIntervalEXT;
417 }
418 if (!debug_fn.wglSwapLayerBuffersFn) {
419 debug_fn.wglSwapLayerBuffersFn = fn.wglSwapLayerBuffersFn;
420 fn.wglSwapLayerBuffersFn = Debug_wglSwapLayerBuffers;
421 }
422 g_debugBindingsInitialized = true;
423 } 119 }
424 120
425 void DriverWGL::ClearBindings() { 121 void DriverWGL::ClearBindings() {
426 memset(this, 0, sizeof(*this)); 122 memset(this, 0, sizeof(*this));
427 } 123 }
428 124
429 BOOL WGLApiBase::wglChoosePixelFormatARBFn(HDC dc, 125 BOOL WGLApiBase::wglChoosePixelFormatARBFn(HDC dc,
430 const int* int_attrib_list, 126 const int* int_attrib_list,
431 const float* float_attrib_list, 127 const float* float_attrib_list,
432 UINT max_formats, 128 UINT max_formats,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 BOOL TraceWGLApi::wglSwapIntervalEXTFn(int interval) { 319 BOOL TraceWGLApi::wglSwapIntervalEXTFn(int interval) {
624 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT") 320 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT")
625 return wgl_api_->wglSwapIntervalEXTFn(interval); 321 return wgl_api_->wglSwapIntervalEXTFn(interval);
626 } 322 }
627 323
628 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) { 324 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) {
629 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers") 325 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers")
630 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes); 326 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes);
631 } 327 }
632 328
329 BOOL DebugWGLApi::wglChoosePixelFormatARBFn(HDC dc,
330 const int* int_attrib_list,
331 const float* float_attrib_list,
332 UINT max_formats,
333 int* formats,
334 UINT* num_formats) {
335 GL_SERVICE_LOG("wglChoosePixelFormatARB"
336 << "(" << dc << ", "
337 << static_cast<const void*>(int_attrib_list) << ", "
338 << static_cast<const void*>(float_attrib_list) << ", "
339 << max_formats << ", " << static_cast<const void*>(formats)
340 << ", " << static_cast<const void*>(num_formats) << ")");
341 BOOL result = wgl_api_->wglChoosePixelFormatARBFn(
342 dc, int_attrib_list, float_attrib_list, max_formats, formats,
343 num_formats);
344 GL_SERVICE_LOG("GL_RESULT: " << result);
345 return result;
346 }
347
348 BOOL DebugWGLApi::wglCopyContextFn(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) {
349 GL_SERVICE_LOG("wglCopyContext"
350 << "(" << hglrcSrc << ", " << hglrcDst << ", " << mask << ")");
351 BOOL result = wgl_api_->wglCopyContextFn(hglrcSrc, hglrcDst, mask);
352 GL_SERVICE_LOG("GL_RESULT: " << result);
353 return result;
354 }
355
356 HGLRC DebugWGLApi::wglCreateContextFn(HDC hdc) {
357 GL_SERVICE_LOG("wglCreateContext"
358 << "(" << hdc << ")");
359 HGLRC result = wgl_api_->wglCreateContextFn(hdc);
360 GL_SERVICE_LOG("GL_RESULT: " << result);
361 return result;
362 }
363
364 HGLRC DebugWGLApi::wglCreateContextAttribsARBFn(HDC hDC,
365 HGLRC hShareContext,
366 const int* attribList) {
367 GL_SERVICE_LOG("wglCreateContextAttribsARB"
368 << "(" << hDC << ", " << hShareContext << ", "
369 << static_cast<const void*>(attribList) << ")");
370 HGLRC result =
371 wgl_api_->wglCreateContextAttribsARBFn(hDC, hShareContext, attribList);
372 GL_SERVICE_LOG("GL_RESULT: " << result);
373 return result;
374 }
375
376 HGLRC DebugWGLApi::wglCreateLayerContextFn(HDC hdc, int iLayerPlane) {
377 GL_SERVICE_LOG("wglCreateLayerContext"
378 << "(" << hdc << ", " << iLayerPlane << ")");
379 HGLRC result = wgl_api_->wglCreateLayerContextFn(hdc, iLayerPlane);
380 GL_SERVICE_LOG("GL_RESULT: " << result);
381 return result;
382 }
383
384 HPBUFFERARB DebugWGLApi::wglCreatePbufferARBFn(HDC hDC,
385 int iPixelFormat,
386 int iWidth,
387 int iHeight,
388 const int* piAttribList) {
389 GL_SERVICE_LOG("wglCreatePbufferARB"
390 << "(" << hDC << ", " << iPixelFormat << ", " << iWidth << ", "
391 << iHeight << ", " << static_cast<const void*>(piAttribList)
392 << ")");
393 HPBUFFERARB result = wgl_api_->wglCreatePbufferARBFn(
394 hDC, iPixelFormat, iWidth, iHeight, piAttribList);
395 GL_SERVICE_LOG("GL_RESULT: " << result);
396 return result;
397 }
398
399 BOOL DebugWGLApi::wglDeleteContextFn(HGLRC hglrc) {
400 GL_SERVICE_LOG("wglDeleteContext"
401 << "(" << hglrc << ")");
402 BOOL result = wgl_api_->wglDeleteContextFn(hglrc);
403 GL_SERVICE_LOG("GL_RESULT: " << result);
404 return result;
405 }
406
407 BOOL DebugWGLApi::wglDestroyPbufferARBFn(HPBUFFERARB hPbuffer) {
408 GL_SERVICE_LOG("wglDestroyPbufferARB"
409 << "(" << hPbuffer << ")");
410 BOOL result = wgl_api_->wglDestroyPbufferARBFn(hPbuffer);
411 GL_SERVICE_LOG("GL_RESULT: " << result);
412 return result;
413 }
414
415 HGLRC DebugWGLApi::wglGetCurrentContextFn() {
416 GL_SERVICE_LOG("wglGetCurrentContext"
417 << "("
418 << ")");
419 HGLRC result = wgl_api_->wglGetCurrentContextFn();
420 GL_SERVICE_LOG("GL_RESULT: " << result);
421 return result;
422 }
423
424 HDC DebugWGLApi::wglGetCurrentDCFn() {
425 GL_SERVICE_LOG("wglGetCurrentDC"
426 << "("
427 << ")");
428 HDC result = wgl_api_->wglGetCurrentDCFn();
429 GL_SERVICE_LOG("GL_RESULT: " << result);
430 return result;
431 }
432
433 const char* DebugWGLApi::wglGetExtensionsStringARBFn(HDC hDC) {
434 GL_SERVICE_LOG("wglGetExtensionsStringARB"
435 << "(" << hDC << ")");
436 const char* result = wgl_api_->wglGetExtensionsStringARBFn(hDC);
437 GL_SERVICE_LOG("GL_RESULT: " << result);
438 return result;
439 }
440
441 const char* DebugWGLApi::wglGetExtensionsStringEXTFn() {
442 GL_SERVICE_LOG("wglGetExtensionsStringEXT"
443 << "("
444 << ")");
445 const char* result = wgl_api_->wglGetExtensionsStringEXTFn();
446 GL_SERVICE_LOG("GL_RESULT: " << result);
447 return result;
448 }
449
450 HDC DebugWGLApi::wglGetPbufferDCARBFn(HPBUFFERARB hPbuffer) {
451 GL_SERVICE_LOG("wglGetPbufferDCARB"
452 << "(" << hPbuffer << ")");
453 HDC result = wgl_api_->wglGetPbufferDCARBFn(hPbuffer);
454 GL_SERVICE_LOG("GL_RESULT: " << result);
455 return result;
456 }
457
458 BOOL DebugWGLApi::wglMakeCurrentFn(HDC hdc, HGLRC hglrc) {
459 GL_SERVICE_LOG("wglMakeCurrent"
460 << "(" << hdc << ", " << hglrc << ")");
461 BOOL result = wgl_api_->wglMakeCurrentFn(hdc, hglrc);
462 GL_SERVICE_LOG("GL_RESULT: " << result);
463 return result;
464 }
465
466 BOOL DebugWGLApi::wglQueryPbufferARBFn(HPBUFFERARB hPbuffer,
467 int iAttribute,
468 int* piValue) {
469 GL_SERVICE_LOG("wglQueryPbufferARB"
470 << "(" << hPbuffer << ", " << iAttribute << ", "
471 << static_cast<const void*>(piValue) << ")");
472 BOOL result = wgl_api_->wglQueryPbufferARBFn(hPbuffer, iAttribute, piValue);
473 GL_SERVICE_LOG("GL_RESULT: " << result);
474 return result;
475 }
476
477 int DebugWGLApi::wglReleasePbufferDCARBFn(HPBUFFERARB hPbuffer, HDC hDC) {
478 GL_SERVICE_LOG("wglReleasePbufferDCARB"
479 << "(" << hPbuffer << ", " << hDC << ")");
480 int result = wgl_api_->wglReleasePbufferDCARBFn(hPbuffer, hDC);
481 GL_SERVICE_LOG("GL_RESULT: " << result);
482 return result;
483 }
484
485 BOOL DebugWGLApi::wglShareListsFn(HGLRC hglrc1, HGLRC hglrc2) {
486 GL_SERVICE_LOG("wglShareLists"
487 << "(" << hglrc1 << ", " << hglrc2 << ")");
488 BOOL result = wgl_api_->wglShareListsFn(hglrc1, hglrc2);
489 GL_SERVICE_LOG("GL_RESULT: " << result);
490 return result;
491 }
492
493 BOOL DebugWGLApi::wglSwapIntervalEXTFn(int interval) {
494 GL_SERVICE_LOG("wglSwapIntervalEXT"
495 << "(" << interval << ")");
496 BOOL result = wgl_api_->wglSwapIntervalEXTFn(interval);
497 GL_SERVICE_LOG("GL_RESULT: " << result);
498 return result;
499 }
500
501 BOOL DebugWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) {
502 GL_SERVICE_LOG("wglSwapLayerBuffers"
503 << "(" << hdc << ", " << fuPlanes << ")");
504 BOOL result = wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes);
505 GL_SERVICE_LOG("GL_RESULT: " << result);
506 return result;
507 }
508
633 } // namespace gl 509 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_osmesa.cc ('k') | ui/gl/gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698