summaryrefslogtreecommitdiffstats
path: root/ui/gfx/gl/gl_surface_win.cc
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 22:29:38 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 22:29:38 +0000
commit0f5e88813352010d2deab433c8061a09018d917c (patch)
tree344ae69b7d335c1c7d370505acd794cbdce28dc1 /ui/gfx/gl/gl_surface_win.cc
parentf2e80774a2d4c58d00fc61394bccc28e5fdc9f67 (diff)
downloadchromium_src-0f5e88813352010d2deab433c8061a09018d917c.zip
chromium_src-0f5e88813352010d2deab433c8061a09018d917c.tar.gz
chromium_src-0f5e88813352010d2deab433c8061a09018d917c.tar.bz2
Fix --use-gl=any command-line option. The current implementation only checks for the availability of certain shared libraries to determine of a GL implementation is feasible. You really have to actually create a context and check pixel formats to determine the feasibilty. Thsi patch refactors GLSurface::InitializeOneOff() to do further checking.
BUG=102672 Review URL: http://codereview.chromium.org/8451008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/gl/gl_surface_win.cc')
-rw-r--r--ui/gfx/gl/gl_surface_win.cc22
1 files changed, 1 insertions, 21 deletions
diff --git a/ui/gfx/gl/gl_surface_win.cc b/ui/gfx/gl/gl_surface_win.cc
index 77810af..e6abf55 100644
--- a/ui/gfx/gl/gl_surface_win.cc
+++ b/ui/gfx/gl/gl_surface_win.cc
@@ -42,25 +42,7 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
// Helper routine that does one-off initialization like determining the
// pixel format and initializing the GL bindings.
-bool GLSurface::InitializeOneOff() {
- static bool initialized = false;
- if (initialized)
- return true;
-
- static const GLImplementation kAllowedGLImplementations[] = {
- kGLImplementationEGLGLES2,
- kGLImplementationDesktopGL,
- kGLImplementationOSMesaGL
- };
-
- if (!InitializeRequestedGLBindings(
- kAllowedGLImplementations,
- kAllowedGLImplementations + arraysize(kAllowedGLImplementations),
- kGLImplementationEGLGLES2)) {
- LOG(ERROR) << "InitializeRequestedGLBindings failed.";
- return false;
- }
-
+bool GLSurface::InitializeOneOffInternal() {
switch (GetGLImplementation()) {
case kGLImplementationDesktopGL:
if (!GLSurfaceWGL::InitializeOneOff()) {
@@ -75,8 +57,6 @@ bool GLSurface::InitializeOneOff() {
}
break;
}
-
- initialized = true;
return true;
}