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

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

Issue 2715563002: Moving SwiftShader from component to bundled library (Closed)
Patch Set: Update past extension test fixes Created 3 years, 9 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_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..a8e3d424fa063c1b612aa0862987f6848fcbe965 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"
@@ -39,8 +40,10 @@ const char kEGLLibraryName[] = "libEGL.so.1";
const char kGLESv2ANGLELibraryName[] = "libGLESv2.so";
const char kEGLANGLELibraryName[] = "libEGL.so";
+#if BUILDFLAG(ENABLE_SWIFTSHADER)
const char kGLESv2SwiftShaderLibraryName[] = "libGLESv2.so";
const char kEGLSwiftShaderLibraryName[] = "libEGL.so";
+#endif
bool InitializeStaticGLXInternal() {
base::NativeLibrary library = NULL;
@@ -84,23 +87,28 @@ 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)
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);
+#else
+ return false;
+#endif
}
base::NativeLibrary gles_library = LoadLibraryAndPrintError(glesv2_path);
« no previous file with comments | « 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