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

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

Issue 2017623002: Create core profile contexts with WGL when --enable-unsafe-es3-apis is used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_wgl.h ('k') | ui/gl/gl_context_wgl.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 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
(...skipping 11 matching lines...) Expand all
22 22
23 static bool g_debugBindingsInitialized; 23 static bool g_debugBindingsInitialized;
24 DriverWGL g_driver_wgl; 24 DriverWGL g_driver_wgl;
25 25
26 void DriverWGL::InitializeStaticBindings() { 26 void DriverWGL::InitializeStaticBindings() {
27 fn.wglChoosePixelFormatARBFn = 0; 27 fn.wglChoosePixelFormatARBFn = 0;
28 fn.wglCopyContextFn = 28 fn.wglCopyContextFn =
29 reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext")); 29 reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext"));
30 fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>( 30 fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>(
31 GetGLProcAddress("wglCreateContext")); 31 GetGLProcAddress("wglCreateContext"));
32 fn.wglCreateContextAttribsARBFn = 0;
32 fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>( 33 fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>(
33 GetGLProcAddress("wglCreateLayerContext")); 34 GetGLProcAddress("wglCreateLayerContext"));
34 fn.wglCreatePbufferARBFn = 0; 35 fn.wglCreatePbufferARBFn = 0;
35 fn.wglDeleteContextFn = reinterpret_cast<wglDeleteContextProc>( 36 fn.wglDeleteContextFn = reinterpret_cast<wglDeleteContextProc>(
36 GetGLProcAddress("wglDeleteContext")); 37 GetGLProcAddress("wglDeleteContext"));
37 fn.wglDestroyPbufferARBFn = 0; 38 fn.wglDestroyPbufferARBFn = 0;
38 fn.wglGetCurrentContextFn = reinterpret_cast<wglGetCurrentContextProc>( 39 fn.wglGetCurrentContextFn = reinterpret_cast<wglGetCurrentContextProc>(
39 GetGLProcAddress("wglGetCurrentContext")); 40 GetGLProcAddress("wglGetCurrentContext"));
40 fn.wglGetCurrentDCFn = reinterpret_cast<wglGetCurrentDCProc>( 41 fn.wglGetCurrentDCFn = reinterpret_cast<wglGetCurrentDCProc>(
41 GetGLProcAddress("wglGetCurrentDC")); 42 GetGLProcAddress("wglGetCurrentDC"));
(...skipping 13 matching lines...) Expand all
55 fn.wglSwapIntervalEXTFn = 0; 56 fn.wglSwapIntervalEXTFn = 0;
56 fn.wglSwapLayerBuffersFn = reinterpret_cast<wglSwapLayerBuffersProc>( 57 fn.wglSwapLayerBuffersFn = reinterpret_cast<wglSwapLayerBuffersProc>(
57 GetGLProcAddress("wglSwapLayerBuffers")); 58 GetGLProcAddress("wglSwapLayerBuffers"));
58 } 59 }
59 60
60 void DriverWGL::InitializeExtensionBindings() { 61 void DriverWGL::InitializeExtensionBindings() {
61 std::string extensions(GetPlatformExtensions()); 62 std::string extensions(GetPlatformExtensions());
62 extensions += " "; 63 extensions += " ";
63 ALLOW_UNUSED_LOCAL(extensions); 64 ALLOW_UNUSED_LOCAL(extensions);
64 65
66 ext.b_WGL_ARB_create_context =
67 extensions.find("WGL_ARB_create_context ") != std::string::npos;
65 ext.b_WGL_ARB_extensions_string = 68 ext.b_WGL_ARB_extensions_string =
66 extensions.find("WGL_ARB_extensions_string ") != std::string::npos; 69 extensions.find("WGL_ARB_extensions_string ") != std::string::npos;
67 ext.b_WGL_ARB_pbuffer = 70 ext.b_WGL_ARB_pbuffer =
68 extensions.find("WGL_ARB_pbuffer ") != std::string::npos; 71 extensions.find("WGL_ARB_pbuffer ") != std::string::npos;
69 ext.b_WGL_ARB_pixel_format = 72 ext.b_WGL_ARB_pixel_format =
70 extensions.find("WGL_ARB_pixel_format ") != std::string::npos; 73 extensions.find("WGL_ARB_pixel_format ") != std::string::npos;
71 ext.b_WGL_EXT_extensions_string = 74 ext.b_WGL_EXT_extensions_string =
72 extensions.find("WGL_EXT_extensions_string ") != std::string::npos; 75 extensions.find("WGL_EXT_extensions_string ") != std::string::npos;
73 ext.b_WGL_EXT_swap_control = 76 ext.b_WGL_EXT_swap_control =
74 extensions.find("WGL_EXT_swap_control ") != std::string::npos; 77 extensions.find("WGL_EXT_swap_control ") != std::string::npos;
75 78
76 debug_fn.wglChoosePixelFormatARBFn = 0; 79 debug_fn.wglChoosePixelFormatARBFn = 0;
77 if (ext.b_WGL_ARB_pixel_format) { 80 if (ext.b_WGL_ARB_pixel_format) {
78 fn.wglChoosePixelFormatARBFn = 81 fn.wglChoosePixelFormatARBFn =
79 reinterpret_cast<wglChoosePixelFormatARBProc>( 82 reinterpret_cast<wglChoosePixelFormatARBProc>(
80 GetGLProcAddress("wglChoosePixelFormatARB")); 83 GetGLProcAddress("wglChoosePixelFormatARB"));
81 } 84 }
82 85
86 debug_fn.wglCreateContextAttribsARBFn = 0;
87 if (ext.b_WGL_ARB_create_context) {
88 fn.wglCreateContextAttribsARBFn =
89 reinterpret_cast<wglCreateContextAttribsARBProc>(
90 GetGLProcAddress("wglCreateContextAttribsARB"));
91 }
92
83 debug_fn.wglCreatePbufferARBFn = 0; 93 debug_fn.wglCreatePbufferARBFn = 0;
84 if (ext.b_WGL_ARB_pbuffer) { 94 if (ext.b_WGL_ARB_pbuffer) {
85 fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>( 95 fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>(
86 GetGLProcAddress("wglCreatePbufferARB")); 96 GetGLProcAddress("wglCreatePbufferARB"));
87 } 97 }
88 98
89 debug_fn.wglDestroyPbufferARBFn = 0; 99 debug_fn.wglDestroyPbufferARBFn = 0;
90 if (ext.b_WGL_ARB_pbuffer) { 100 if (ext.b_WGL_ARB_pbuffer) {
91 fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>( 101 fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>(
92 GetGLProcAddress("wglDestroyPbufferARB")); 102 GetGLProcAddress("wglDestroyPbufferARB"));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 167
158 static HGLRC GL_BINDING_CALL Debug_wglCreateContext(HDC hdc) { 168 static HGLRC GL_BINDING_CALL Debug_wglCreateContext(HDC hdc) {
159 GL_SERVICE_LOG("wglCreateContext" 169 GL_SERVICE_LOG("wglCreateContext"
160 << "(" << hdc << ")"); 170 << "(" << hdc << ")");
161 DCHECK(g_driver_wgl.debug_fn.wglCreateContextFn != nullptr); 171 DCHECK(g_driver_wgl.debug_fn.wglCreateContextFn != nullptr);
162 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextFn(hdc); 172 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextFn(hdc);
163 GL_SERVICE_LOG("GL_RESULT: " << result); 173 GL_SERVICE_LOG("GL_RESULT: " << result);
164 return result; 174 return result;
165 } 175 }
166 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
167 static HGLRC GL_BINDING_CALL Debug_wglCreateLayerContext(HDC hdc, 191 static HGLRC GL_BINDING_CALL Debug_wglCreateLayerContext(HDC hdc,
168 int iLayerPlane) { 192 int iLayerPlane) {
169 GL_SERVICE_LOG("wglCreateLayerContext" 193 GL_SERVICE_LOG("wglCreateLayerContext"
170 << "(" << hdc << ", " << iLayerPlane << ")"); 194 << "(" << hdc << ", " << iLayerPlane << ")");
171 DCHECK(g_driver_wgl.debug_fn.wglCreateLayerContextFn != nullptr); 195 DCHECK(g_driver_wgl.debug_fn.wglCreateLayerContextFn != nullptr);
172 HGLRC result = 196 HGLRC result =
173 g_driver_wgl.debug_fn.wglCreateLayerContextFn(hdc, iLayerPlane); 197 g_driver_wgl.debug_fn.wglCreateLayerContextFn(hdc, iLayerPlane);
174 GL_SERVICE_LOG("GL_RESULT: " << result); 198 GL_SERVICE_LOG("GL_RESULT: " << result);
175 return result; 199 return result;
176 } 200 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 fn.wglChoosePixelFormatARBFn = Debug_wglChoosePixelFormatARB; 348 fn.wglChoosePixelFormatARBFn = Debug_wglChoosePixelFormatARB;
325 } 349 }
326 if (!debug_fn.wglCopyContextFn) { 350 if (!debug_fn.wglCopyContextFn) {
327 debug_fn.wglCopyContextFn = fn.wglCopyContextFn; 351 debug_fn.wglCopyContextFn = fn.wglCopyContextFn;
328 fn.wglCopyContextFn = Debug_wglCopyContext; 352 fn.wglCopyContextFn = Debug_wglCopyContext;
329 } 353 }
330 if (!debug_fn.wglCreateContextFn) { 354 if (!debug_fn.wglCreateContextFn) {
331 debug_fn.wglCreateContextFn = fn.wglCreateContextFn; 355 debug_fn.wglCreateContextFn = fn.wglCreateContextFn;
332 fn.wglCreateContextFn = Debug_wglCreateContext; 356 fn.wglCreateContextFn = Debug_wglCreateContext;
333 } 357 }
358 if (!debug_fn.wglCreateContextAttribsARBFn) {
359 debug_fn.wglCreateContextAttribsARBFn = fn.wglCreateContextAttribsARBFn;
360 fn.wglCreateContextAttribsARBFn = Debug_wglCreateContextAttribsARB;
361 }
334 if (!debug_fn.wglCreateLayerContextFn) { 362 if (!debug_fn.wglCreateLayerContextFn) {
335 debug_fn.wglCreateLayerContextFn = fn.wglCreateLayerContextFn; 363 debug_fn.wglCreateLayerContextFn = fn.wglCreateLayerContextFn;
336 fn.wglCreateLayerContextFn = Debug_wglCreateLayerContext; 364 fn.wglCreateLayerContextFn = Debug_wglCreateLayerContext;
337 } 365 }
338 if (!debug_fn.wglCreatePbufferARBFn) { 366 if (!debug_fn.wglCreatePbufferARBFn) {
339 debug_fn.wglCreatePbufferARBFn = fn.wglCreatePbufferARBFn; 367 debug_fn.wglCreatePbufferARBFn = fn.wglCreatePbufferARBFn;
340 fn.wglCreatePbufferARBFn = Debug_wglCreatePbufferARB; 368 fn.wglCreatePbufferARBFn = Debug_wglCreatePbufferARB;
341 } 369 }
342 if (!debug_fn.wglDeleteContextFn) { 370 if (!debug_fn.wglDeleteContextFn) {
343 debug_fn.wglDeleteContextFn = fn.wglDeleteContextFn; 371 debug_fn.wglDeleteContextFn = fn.wglDeleteContextFn;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 438 }
411 439
412 BOOL WGLApiBase::wglCopyContextFn(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { 440 BOOL WGLApiBase::wglCopyContextFn(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) {
413 return driver_->fn.wglCopyContextFn(hglrcSrc, hglrcDst, mask); 441 return driver_->fn.wglCopyContextFn(hglrcSrc, hglrcDst, mask);
414 } 442 }
415 443
416 HGLRC WGLApiBase::wglCreateContextFn(HDC hdc) { 444 HGLRC WGLApiBase::wglCreateContextFn(HDC hdc) {
417 return driver_->fn.wglCreateContextFn(hdc); 445 return driver_->fn.wglCreateContextFn(hdc);
418 } 446 }
419 447
448 HGLRC WGLApiBase::wglCreateContextAttribsARBFn(HDC hDC,
449 HGLRC hShareContext,
450 const int* attribList) {
451 return driver_->fn.wglCreateContextAttribsARBFn(hDC, hShareContext,
452 attribList);
453 }
454
420 HGLRC WGLApiBase::wglCreateLayerContextFn(HDC hdc, int iLayerPlane) { 455 HGLRC WGLApiBase::wglCreateLayerContextFn(HDC hdc, int iLayerPlane) {
421 return driver_->fn.wglCreateLayerContextFn(hdc, iLayerPlane); 456 return driver_->fn.wglCreateLayerContextFn(hdc, iLayerPlane);
422 } 457 }
423 458
424 HPBUFFERARB WGLApiBase::wglCreatePbufferARBFn(HDC hDC, 459 HPBUFFERARB WGLApiBase::wglCreatePbufferARBFn(HDC hDC,
425 int iPixelFormat, 460 int iPixelFormat,
426 int iWidth, 461 int iWidth,
427 int iHeight, 462 int iHeight,
428 const int* piAttribList) { 463 const int* piAttribList) {
429 return driver_->fn.wglCreatePbufferARBFn(hDC, iPixelFormat, iWidth, iHeight, 464 return driver_->fn.wglCreatePbufferARBFn(hDC, iPixelFormat, iWidth, iHeight,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 BOOL TraceWGLApi::wglCopyContextFn(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { 534 BOOL TraceWGLApi::wglCopyContextFn(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) {
500 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCopyContext") 535 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCopyContext")
501 return wgl_api_->wglCopyContextFn(hglrcSrc, hglrcDst, mask); 536 return wgl_api_->wglCopyContextFn(hglrcSrc, hglrcDst, mask);
502 } 537 }
503 538
504 HGLRC TraceWGLApi::wglCreateContextFn(HDC hdc) { 539 HGLRC TraceWGLApi::wglCreateContextFn(HDC hdc) {
505 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCreateContext") 540 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCreateContext")
506 return wgl_api_->wglCreateContextFn(hdc); 541 return wgl_api_->wglCreateContextFn(hdc);
507 } 542 }
508 543
544 HGLRC TraceWGLApi::wglCreateContextAttribsARBFn(HDC hDC,
545 HGLRC hShareContext,
546 const int* attribList) {
547 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCreateContextAttribsARB")
548 return wgl_api_->wglCreateContextAttribsARBFn(hDC, hShareContext, attribList);
549 }
550
509 HGLRC TraceWGLApi::wglCreateLayerContextFn(HDC hdc, int iLayerPlane) { 551 HGLRC TraceWGLApi::wglCreateLayerContextFn(HDC hdc, int iLayerPlane) {
510 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCreateLayerContext") 552 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglCreateLayerContext")
511 return wgl_api_->wglCreateLayerContextFn(hdc, iLayerPlane); 553 return wgl_api_->wglCreateLayerContextFn(hdc, iLayerPlane);
512 } 554 }
513 555
514 HPBUFFERARB TraceWGLApi::wglCreatePbufferARBFn(HDC hDC, 556 HPBUFFERARB TraceWGLApi::wglCreatePbufferARBFn(HDC hDC,
515 int iPixelFormat, 557 int iPixelFormat,
516 int iWidth, 558 int iWidth,
517 int iHeight, 559 int iHeight,
518 const int* piAttribList) { 560 const int* piAttribList) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT") 624 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT")
583 return wgl_api_->wglSwapIntervalEXTFn(interval); 625 return wgl_api_->wglSwapIntervalEXTFn(interval);
584 } 626 }
585 627
586 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) { 628 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) {
587 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers") 629 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers")
588 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes); 630 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes);
589 } 631 }
590 632
591 } // namespace gl 633 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_wgl.h ('k') | ui/gl/gl_context_wgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698