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

Unified Diff: ui/gl/gl_implementation_ozone.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_mac.cc ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_implementation_ozone.cc
diff --git a/ui/gl/gl_implementation_ozone.cc b/ui/gl/gl_implementation_ozone.cc
index 10ab44d5b25936ee595a43ab4c7c5a14c145af05..0d9fe6b310de1729ab641bb861b28ae5b1278567 100644
--- a/ui/gl/gl_implementation_ozone.cc
+++ b/ui/gl/gl_implementation_ozone.cc
@@ -5,6 +5,7 @@
#include "base/bind.h"
#include "ui/gfx/ozone/surface_factory_ozone.h"
#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_context_stub_with_extensions.h"
#include "ui/gl/gl_egl_api_implementation.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_implementation.h"
@@ -32,7 +33,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.
@@ -41,7 +42,7 @@ bool InitializeGLBindings(GLImplementation implementation) {
switch (implementation) {
case kGLImplementationOSMesaGL:
- return InitializeGLBindingsOSMesaGL();
+ return InitializeStaticGLBindingsOSMesaGL();
case kGLImplementationEGLGLES2:
ui::OzonePlatform::Initialize();
if (!gfx::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings(
@@ -49,8 +50,8 @@ bool InitializeGLBindings(GLImplementation implementation) {
base::Bind(&SetGLGetProcAddressProc)))
return false;
SetGLImplementation(kGLImplementationEGLGLES2);
- InitializeGLBindingsGL();
- InitializeGLBindingsEGL();
+ InitializeStaticGLBindingsGL();
+ InitializeStaticGLBindingsEGL();
// These two functions take single precision float rather than double
// precision float parameters in GLES.
@@ -60,7 +61,7 @@ bool InitializeGLBindings(GLImplementation implementation) {
case kGLImplementationMockGL: {
SetGLGetProcAddressProc(GetMockGLProcAddress);
SetGLImplementation(kGLImplementationMockGL);
- InitializeGLBindingsGL();
+ InitializeStaticGLBindingsGL();
break;
}
default:
@@ -72,19 +73,25 @@ bool InitializeGLBindings(GLImplementation implementation) {
return true;
}
-bool InitializeGLExtensionBindings(GLImplementation implementation,
- GLContext* context) {
+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 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_mac.cc ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698