From 0f5e88813352010d2deab433c8061a09018d917c Mon Sep 17 00:00:00 2001
From: "alokp@chromium.org"
 <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 8 Nov 2011 22:29:38 +0000
Subject: 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
---
 ui/gfx/gl/gl_implementation.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

(limited to 'ui/gfx/gl/gl_implementation.h')

diff --git a/ui/gfx/gl/gl_implementation.h b/ui/gfx/gl/gl_implementation.h
index f675914..cfbb33a 100644
--- a/ui/gfx/gl/gl_implementation.h
+++ b/ui/gfx/gl/gl_implementation.h
@@ -7,6 +7,7 @@
 #pragma once
 
 #include <string>
+#include <vector>
 
 #include "base/native_library.h"
 #include "build/build_config.h"
@@ -26,6 +27,8 @@ enum GLImplementation {
   kGLImplementationMockGL
 };
 
+void GetAllowedGLImplementations(std::vector<GLImplementation>* impls);
+
 #if defined(OS_WIN)
 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name);
 #else
@@ -42,6 +45,8 @@ GL_EXPORT bool InitializeGLExtensionBindings(GLImplementation implementation,
 // Initialize Debug logging wrappers for GL bindings.
 void InitializeDebugGLBindings();
 
+void ClearGLBindings();
+
 // Set the current GL implementation.
 void SetGLImplementation(GLImplementation implementation);
 
@@ -53,25 +58,17 @@ GL_EXPORT GLImplementation GetGLImplementation();
 GL_EXPORT bool HasDesktopGLFeatures();
 
 // Get the GL implementation with a given name.
-GLImplementation GetNamedGLImplementation(const std::wstring& name);
+GLImplementation GetNamedGLImplementation(const std::string& name);
 
 // Get the name of a GL implementation.
 const char* GetGLImplementationName(GLImplementation implementation);
 
-// Get whether the current GL implementation is swiftshader.
-bool UsingSwiftShader();
-
-// Initialize the preferred GL binding from the given list. The preferred GL
-// bindings depend on command line switches passed by the user and which GL
-// implementation is the default on a given platform.
-bool InitializeRequestedGLBindings(
-    const GLImplementation* allowed_implementations_begin,
-    const GLImplementation* allowed_implementations_end,
-    GLImplementation default_implementation);
-
 // Add a native library to those searched for GL entry points.
 void AddGLNativeLibrary(base::NativeLibrary library);
 
+// Unloads all native libraries.
+void UnloadGLNativeLibraries();
+
 // Set an additional function that will be called to find GL entry points.
 void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
 
-- 
cgit v1.1