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

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

Issue 2715563002: Moving SwiftShader from component to bundled library (Closed)
Patch Set: Specify x11 only support on Linux Created 3 years, 10 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
« ui/gl/init/gl_initializer_win.cc ('K') | « ui/gl/init/gl_initializer_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_initializer_x11.cc
diff --git a/ui/gl/init/gl_initializer_x11.cc b/ui/gl/init/gl_initializer_x11.cc
index 2d88875feec399b83d64d07d924aaa0137c22e8f..a4d9a2f5cc502cacc5f947bb2fc0599dd93399f6 100644
--- a/ui/gl/init/gl_initializer_x11.cc
+++ b/ui/gl/init/gl_initializer_x11.cc
@@ -13,6 +13,7 @@
#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_egl_api_implementation.h"
+#include "ui/gl/gl_features.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_glx_api_implementation.h"
#include "ui/gl/gl_implementation_osmesa.h"
@@ -84,20 +85,24 @@ bool InitializeStaticEGLInternal() {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
- if (command_line->GetSwitchValueASCII(switches::kUseGL) ==
- kGLImplementationANGLEName) {
+ const std::string use_gl =
+ command_line->GetSwitchValueASCII(switches::kUseGL);
+ if (use_gl == kGLImplementationANGLEName) {
base::FilePath module_path;
if (!PathService::Get(base::DIR_MODULE, &module_path))
return false;
glesv2_path = module_path.Append(kGLESv2ANGLELibraryName);
egl_path = module_path.Append(kEGLANGLELibraryName);
- } else if (command_line->GetSwitchValueASCII(switches::kUseGL) ==
- kGLImplementationSwiftShaderName) {
+ } else if ((use_gl == kGLImplementationSwiftShaderName) ||
+ (use_gl == kGLImplementationSwiftShaderForWebGLName)) {
+#if !BUILDFLAG(ENABLE_SWIFTSHADER)
+ return false;
+#endif
base::FilePath module_path;
- if (!command_line->HasSwitch(switches::kSwiftShaderPath))
+ if (!PathService::Get(base::DIR_MODULE, &module_path))
return false;
- module_path = command_line->GetSwitchValuePath(switches::kSwiftShaderPath);
+ module_path = module_path.Append("swiftshader/");
glesv2_path = module_path.Append(kGLESv2SwiftShaderLibraryName);
egl_path = module_path.Append(kEGLSwiftShaderLibraryName);
« ui/gl/init/gl_initializer_win.cc ('K') | « ui/gl/init/gl_initializer_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698