Index: ui/gl/gl_implementation_win.cc |
diff --git a/ui/gl/gl_implementation_win.cc b/ui/gl/gl_implementation_win.cc |
index 87328a306f8f4783a4535073ff5a4f215f263e17..91874cfd14294c8337b3b5c3b3e823c110f72598 100644 |
--- a/ui/gl/gl_implementation_win.cc |
+++ b/ui/gl/gl_implementation_win.cc |
@@ -17,6 +17,7 @@ |
#include "base/threading/thread_restrictions.h" |
#include "base/win/windows_version.h" |
#include "ui/gl/gl_bindings.h" |
+#include "ui/gl/gl_context_mock_version.h" |
#include "ui/gl/gl_egl_api_implementation.h" |
#include "ui/gl/gl_gl_api_implementation.h" |
#include "ui/gl/gl_implementation.h" |
@@ -106,7 +107,7 @@ void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { |
impls->push_back(kGLImplementationOSMesaGL); |
} |
-bool InitializeGLBindings(GLImplementation implementation) { |
+bool InitializeStaticGLBindings(GLImplementation implementation) { |
// Prevent reinitialization with a different implementation. Once the gpu |
// unit tests have initialized with kGLImplementationMock, we don't want to |
// later switch to another GL implementation. |
@@ -148,8 +149,8 @@ bool InitializeGLBindings(GLImplementation implementation) { |
AddGLNativeLibrary(library); |
SetGLImplementation(kGLImplementationOSMesaGL); |
- InitializeGLBindingsGL(); |
- InitializeGLBindingsOSMESA(); |
+ InitializeStaticGLBindingsGL(); |
+ InitializeStaticGLBindingsOSMESA(); |
break; |
} |
case kGLImplementationEGLGLES2: { |
@@ -234,8 +235,8 @@ bool InitializeGLBindings(GLImplementation implementation) { |
AddGLNativeLibrary(gles_library); |
SetGLImplementation(kGLImplementationEGLGLES2); |
- InitializeGLBindingsGL(); |
- InitializeGLBindingsEGL(); |
+ InitializeStaticGLBindingsGL(); |
+ InitializeStaticGLBindingsEGL(); |
// These two functions take single precision float rather than double |
// precision float parameters in GLES. |
@@ -267,14 +268,14 @@ bool InitializeGLBindings(GLImplementation implementation) { |
AddGLNativeLibrary(library); |
SetGLImplementation(kGLImplementationDesktopGL); |
- InitializeGLBindingsGL(); |
- InitializeGLBindingsWGL(); |
+ InitializeStaticGLBindingsGL(); |
+ InitializeStaticGLBindingsWGL(); |
break; |
} |
case kGLImplementationMockGL: { |
SetGLGetProcAddressProc(GetMockGLProcAddress); |
SetGLImplementation(kGLImplementationMockGL); |
- InitializeGLBindingsGL(); |
+ InitializeStaticGLBindingsGL(); |
break; |
} |
default: |
@@ -284,23 +285,27 @@ bool InitializeGLBindings(GLImplementation implementation) { |
return true; |
} |
-bool InitializeGLExtensionBindings(GLImplementation implementation, |
+bool InitializeDynamicGLBindings(GLImplementation implementation, |
GLContext* context) { |
switch (implementation) { |
case kGLImplementationOSMesaGL: |
- InitializeGLExtensionBindingsGL(context); |
- InitializeGLExtensionBindingsOSMESA(context); |
+ InitializeDynamicGLBindingsGL(context); |
+ InitializeDynamicGLBindingsOSMESA(context); |
break; |
case kGLImplementationEGLGLES2: |
- InitializeGLExtensionBindingsGL(context); |
- InitializeGLExtensionBindingsEGL(context); |
+ InitializeDynamicGLBindingsGL(context); |
+ InitializeDynamicGLBindingsEGL(context); |
break; |
case kGLImplementationDesktopGL: |
- InitializeGLExtensionBindingsGL(context); |
- InitializeGLExtensionBindingsWGL(context); |
+ InitializeDynamicGLBindingsGL(context); |
+ InitializeDynamicGLBindingsWGL(context); |
break; |
case kGLImplementationMockGL: |
- InitializeGLExtensionBindingsGL(context); |
+ { |
+ scoped_refptr<GLContextMockVersion> mock_context( |
+ new GLContextMockVersion("3.0")); |
+ InitializeDynamicGLBindingsGL(mock_context.get()); |
+ } |
break; |
default: |
return false; |