Index: ui/gl/gl_bindings_autogen_wgl.cc |
diff --git a/ui/gl/gl_bindings_autogen_wgl.cc b/ui/gl/gl_bindings_autogen_wgl.cc |
index b70f929286b13dc8de1e0116dbe298a427db6637..45ebef07be838e3bc20df84868eac291ae524be7 100644 |
--- a/ui/gl/gl_bindings_autogen_wgl.cc |
+++ b/ui/gl/gl_bindings_autogen_wgl.cc |
@@ -24,17 +24,20 @@ |
DriverWGL g_driver_wgl; |
void DriverWGL::InitializeStaticBindings() { |
- fn.wglChoosePixelFormatARBFn = 0; |
+ fn.wglChoosePixelFormatARBFn = reinterpret_cast<wglChoosePixelFormatARBProc>( |
+ GetGLProcAddress("wglChoosePixelFormatARB")); |
fn.wglCopyContextFn = |
reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext")); |
fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>( |
GetGLProcAddress("wglCreateContext")); |
fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>( |
GetGLProcAddress("wglCreateLayerContext")); |
- fn.wglCreatePbufferARBFn = 0; |
+ fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>( |
+ GetGLProcAddress("wglCreatePbufferARB")); |
fn.wglDeleteContextFn = reinterpret_cast<wglDeleteContextProc>( |
GetGLProcAddress("wglDeleteContext")); |
- fn.wglDestroyPbufferARBFn = 0; |
+ fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>( |
+ GetGLProcAddress("wglDestroyPbufferARB")); |
fn.wglGetCurrentContextFn = reinterpret_cast<wglGetCurrentContextProc>( |
GetGLProcAddress("wglGetCurrentContext")); |
fn.wglGetCurrentDCFn = reinterpret_cast<wglGetCurrentDCProc>( |
@@ -45,18 +48,27 @@ |
fn.wglGetExtensionsStringEXTFn = |
reinterpret_cast<wglGetExtensionsStringEXTProc>( |
GetGLProcAddress("wglGetExtensionsStringEXT")); |
- fn.wglGetPbufferDCARBFn = 0; |
+ fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>( |
+ GetGLProcAddress("wglGetPbufferDCARB")); |
fn.wglMakeCurrentFn = |
reinterpret_cast<wglMakeCurrentProc>(GetGLProcAddress("wglMakeCurrent")); |
- fn.wglQueryPbufferARBFn = 0; |
- fn.wglReleasePbufferDCARBFn = 0; |
+ fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>( |
+ GetGLProcAddress("wglQueryPbufferARB")); |
+ fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>( |
+ GetGLProcAddress("wglReleasePbufferDCARB")); |
fn.wglShareListsFn = |
reinterpret_cast<wglShareListsProc>(GetGLProcAddress("wglShareLists")); |
- fn.wglSwapIntervalEXTFn = 0; |
+ fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>( |
+ GetGLProcAddress("wglSwapIntervalEXT")); |
fn.wglSwapLayerBuffersFn = reinterpret_cast<wglSwapLayerBuffersProc>( |
GetGLProcAddress("wglSwapLayerBuffers")); |
- std::string extensions(GetPlatformExtensions()); |
- extensions += " "; |
+} |
+ |
+void DriverWGL::InitializeDynamicBindings(GLContext* context) { |
+ DCHECK(context && context->IsCurrent(NULL)); |
+ const GLVersionInfo* ver = context->GetVersionInfo(); |
+ ALLOW_UNUSED_LOCAL(ver); |
+ std::string extensions = context->GetExtensions() + " "; |
ALLOW_UNUSED_LOCAL(extensions); |
ext.b_WGL_ARB_extensions_string = |
@@ -69,56 +81,6 @@ |
extensions.find("WGL_EXT_extensions_string ") != std::string::npos; |
ext.b_WGL_EXT_swap_control = |
extensions.find("WGL_EXT_swap_control ") != std::string::npos; |
- |
- debug_fn.wglChoosePixelFormatARBFn = 0; |
- if (ext.b_WGL_ARB_pixel_format) { |
- fn.wglChoosePixelFormatARBFn = |
- reinterpret_cast<wglChoosePixelFormatARBProc>( |
- GetGLProcAddress("wglChoosePixelFormatARB")); |
- DCHECK(fn.wglChoosePixelFormatARBFn); |
- } |
- |
- debug_fn.wglCreatePbufferARBFn = 0; |
- if (ext.b_WGL_ARB_pbuffer) { |
- fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>( |
- GetGLProcAddress("wglCreatePbufferARB")); |
- DCHECK(fn.wglCreatePbufferARBFn); |
- } |
- |
- debug_fn.wglDestroyPbufferARBFn = 0; |
- if (ext.b_WGL_ARB_pbuffer) { |
- fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>( |
- GetGLProcAddress("wglDestroyPbufferARB")); |
- DCHECK(fn.wglDestroyPbufferARBFn); |
- } |
- |
- debug_fn.wglGetPbufferDCARBFn = 0; |
- if (ext.b_WGL_ARB_pbuffer) { |
- fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>( |
- GetGLProcAddress("wglGetPbufferDCARB")); |
- DCHECK(fn.wglGetPbufferDCARBFn); |
- } |
- |
- debug_fn.wglQueryPbufferARBFn = 0; |
- if (ext.b_WGL_ARB_pbuffer) { |
- fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>( |
- GetGLProcAddress("wglQueryPbufferARB")); |
- DCHECK(fn.wglQueryPbufferARBFn); |
- } |
- |
- debug_fn.wglReleasePbufferDCARBFn = 0; |
- if (ext.b_WGL_ARB_pbuffer) { |
- fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>( |
- GetGLProcAddress("wglReleasePbufferDCARB")); |
- DCHECK(fn.wglReleasePbufferDCARBFn); |
- } |
- |
- debug_fn.wglSwapIntervalEXTFn = 0; |
- if (ext.b_WGL_EXT_swap_control) { |
- fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>( |
- GetGLProcAddress("wglSwapIntervalEXT")); |
- DCHECK(fn.wglSwapIntervalEXTFn); |
- } |
if (g_debugBindingsInitialized) |
InitializeDebugBindings(); |