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

Unified Diff: ui/gl/gl_implementation_mac.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_implementation_linux.cc ('k') | ui/gl/gl_implementation_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_implementation_mac.cc
diff --git a/ui/gl/gl_implementation_mac.cc b/ui/gl/gl_implementation_mac.cc
index 36bb7e37e503a1e1ebec8ec869ad98e0c8441ece..e7689707f209c84fea2edc0e77f8a91edfc042ac 100644
--- a/ui/gl/gl_implementation_mac.cc
+++ b/ui/gl/gl_implementation_mac.cc
@@ -10,6 +10,7 @@
#include "base/path_service.h"
#include "base/threading/thread_restrictions.h"
#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_context_stub_with_extensions.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_osmesa_api_implementation.h"
@@ -26,7 +27,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.
@@ -77,8 +78,8 @@ bool InitializeGLBindings(GLImplementation implementation) {
AddGLNativeLibrary(library);
SetGLImplementation(kGLImplementationOSMesaGL);
- InitializeGLBindingsGL();
- InitializeGLBindingsOSMESA();
+ InitializeStaticGLBindingsGL();
+ InitializeStaticGLBindingsOSMESA();
break;
}
case kGLImplementationDesktopGL:
@@ -93,13 +94,13 @@ bool InitializeGLBindings(GLImplementation implementation) {
AddGLNativeLibrary(library);
SetGLImplementation(implementation);
- InitializeGLBindingsGL();
+ InitializeStaticGLBindingsGL();
break;
}
case kGLImplementationMockGL: {
SetGLGetProcAddressProc(GetMockGLProcAddress);
SetGLImplementation(kGLImplementationMockGL);
- InitializeGLBindingsGL();
+ InitializeStaticGLBindingsGL();
break;
}
default:
@@ -109,19 +110,25 @@ 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 kGLImplementationDesktopGL:
case kGLImplementationAppleGL:
- InitializeGLExtensionBindingsGL(context);
+ InitializeDynamicGLBindingsGL(context);
break;
case kGLImplementationMockGL:
- InitializeGLExtensionBindingsGL(context);
+ if (!context) {
+ scoped_refptr<GLContextStubWithExtensions> mock_context(
+ new GLContextStubWithExtensions());
+ mock_context->SetGLVersionString("3.0");
+ InitializeDynamicGLBindingsGL(mock_context.get());
+ } else
+ InitializeDynamicGLBindingsGL(context);
break;
default:
return false;
« no previous file with comments | « ui/gl/gl_implementation_linux.cc ('k') | ui/gl/gl_implementation_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698