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

Unified Diff: ui/gl/init/gl_factory.cc

Issue 1542013005: Add a new driver bug workaround SANDBOX_START_EARLY Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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 | « ui/gl/init/gl_factory.h ('k') | ui/gl/init/gl_initializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory.cc
diff --git a/ui/gl/init/gl_factory.cc b/ui/gl/init/gl_factory.cc
index 3c17fc777bfe178be221a9c13d742f99d6823e19..40b06e4215f301240a8585daff0cb61a547963e5 100644
--- a/ui/gl/init/gl_factory.cc
+++ b/ui/gl/init/gl_factory.cc
@@ -22,34 +22,15 @@ bool InitializeGLOneOff() {
DCHECK_EQ(kGLImplementationNone, GetGLImplementation());
+ GLImplementation impl = kGLImplementationNone;
+ bool fallback_to_osmesa = false;
std::vector<GLImplementation> allowed_impls = GetAllowedGLImplementations();
- DCHECK(!allowed_impls.empty());
+ bool result =
+ SelectGLImplementation(allowed_impls, &impl, &fallback_to_osmesa);
+ if (!result)
+ return false;
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
-
- // The default implementation is always the first one in list.
- GLImplementation impl = allowed_impls[0];
- bool fallback_to_osmesa = false;
- if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) {
- impl = kGLImplementationOSMesaGL;
- } else if (cmd->HasSwitch(switches::kUseGL)) {
- std::string requested_implementation_name =
- cmd->GetSwitchValueASCII(switches::kUseGL);
- if (requested_implementation_name == "any") {
- fallback_to_osmesa = true;
- } else if (requested_implementation_name ==
- kGLImplementationSwiftShaderName ||
- requested_implementation_name == kGLImplementationANGLEName) {
- impl = kGLImplementationEGLGLES2;
- } else {
- impl = GetNamedGLImplementation(requested_implementation_name);
- if (!base::ContainsValue(allowed_impls, impl)) {
- LOG(ERROR) << "Requested GL implementation is not available.";
- return false;
- }
- }
- }
-
bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging);
bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests);
@@ -89,5 +70,14 @@ void ClearGLBindings() {
UnloadGLNativeLibraries();
}
+#if !defined(OS_MACOSX)
+bool GetNativeLibraryNamesFromGLImplementation(
+ GLImplementation impl,
+ std::vector<std::string>* required_libraries) {
+ return GetNativeLibraryNamesFromGLImplementationPlatform(impl,
+ required_libraries);
+}
+#endif
+
} // namespace init
} // namespace gl
« no previous file with comments | « ui/gl/init/gl_factory.h ('k') | ui/gl/init/gl_initializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698