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

Unified Diff: app/gfx/gl/gl_implementation.cc

Issue 6314005: Revert 71472 - Use GL rather than EGL by default on linux.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months 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 | « app/gfx/gl/gl_implementation.h ('k') | app/gfx/gl/gl_implementation_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/gl/gl_implementation.cc
===================================================================
--- app/gfx/gl/gl_implementation.cc (revision 71473)
+++ app/gfx/gl/gl_implementation.cc (working copy)
@@ -21,16 +21,6 @@
namespace {
-const struct {
- const char* name;
- GLImplementation implementation;
-} kGLImplementationNamePairs[] = {
- { kGLImplementationDesktopName, kGLImplementationDesktopGL },
- { kGLImplementationOSMesaName, kGLImplementationOSMesaGL },
- { kGLImplementationEGLName, kGLImplementationEGLGLES2 },
- { kGLImplementationMockName, kGLImplementationMockGL }
-};
-
typedef std::vector<base::NativeLibrary> LibraryArray;
GLImplementation g_gl_implementation = kGLImplementationNone;
@@ -50,23 +40,24 @@
}
GLImplementation GetNamedGLImplementation(const std::string& name) {
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kGLImplementationNamePairs); ++i) {
- if (name == kGLImplementationNamePairs[i].name)
- return kGLImplementationNamePairs[i].implementation;
+ static const struct {
+ const char* name;
+ GLImplementation implemention;
+ } name_pairs[] = {
+ { kGLImplementationDesktopName, kGLImplementationDesktopGL },
+ { kGLImplementationOSMesaName, kGLImplementationOSMesaGL },
+ { kGLImplementationEGLName, kGLImplementationEGLGLES2 },
+ { kGLImplementationMockName, kGLImplementationMockGL }
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(name_pairs); ++i) {
+ if (name == name_pairs[i].name)
+ return name_pairs[i].implemention;
}
return kGLImplementationNone;
}
-const char* GetGLImplementationName(GLImplementation implementation) {
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kGLImplementationNamePairs); ++i) {
- if (implementation == kGLImplementationNamePairs[i].implementation)
- return kGLImplementationNamePairs[i].name;
- }
-
- return "unknown";
-}
-
bool InitializeBestGLBindings(
const GLImplementation* allowed_implementations_begin,
const GLImplementation* allowed_implementations_end) {
@@ -78,29 +69,23 @@
if (std::find(allowed_implementations_begin,
allowed_implementations_end,
requested_implementation) == allowed_implementations_end) {
- LOG(ERROR) << "Requested GL implementation is not available.";
+ LOG(ERROR) << "Requested GL implementation is not allowed.";
return false;
}
- InitializeGLBindings(requested_implementation);
+ if (InitializeGLBindings(requested_implementation))
+ return true;
} else {
for (const GLImplementation* p = allowed_implementations_begin;
p < allowed_implementations_end;
++p) {
if (InitializeGLBindings(*p))
- break;
+ return true;
}
}
- if (GetGLImplementation() == kGLImplementationNone) {
- LOG(ERROR) << "Could not initialize GL.";
- return false;
- } else {
- LOG(INFO) << "Using "
- << GetGLImplementationName(GetGLImplementation())
- << " GL implementation.";
- return true;
- }
+ LOG(ERROR) << "Could not initialize GL.";
+ return false;
}
void SetGLImplementation(GLImplementation implementation) {
« no previous file with comments | « app/gfx/gl/gl_implementation.h ('k') | app/gfx/gl/gl_implementation_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698