Index: chrome/browser/gpu/gl_string_manager.cc |
diff --git a/chrome/browser/gpu/gl_string_manager.cc b/chrome/browser/gpu/gl_string_manager.cc |
index 4d03eea94f226e343b70839ddfd2cfe9661f85c4..5b8ce274c7ce7fde39caf4efc88610c9ca49e145 100644 |
--- a/chrome/browser/gpu/gl_string_manager.cc |
+++ b/chrome/browser/gpu/gl_string_manager.cc |
@@ -4,12 +4,14 @@ |
#include "chrome/browser/gpu/gl_string_manager.h" |
+#include "base/command_line.h" |
#include "build/build_config.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/common/pref_names.h" |
#include "components/prefs/pref_registry_simple.h" |
#include "components/prefs/pref_service.h" |
#include "content/public/browser/gpu_data_manager.h" |
+#include "gpu/config/gpu_switches.h" |
// static |
void GLStringManager::RegisterPrefs(PrefRegistrySimple* registry) { |
@@ -38,6 +40,23 @@ void GLStringManager::Initialize() { |
gl_renderer_ = local_state->GetString(prefs::kGLRendererString); |
gl_version_ = local_state->GetString(prefs::kGLVersionString); |
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingGLVendor)) { |
+ gl_vendor_ = |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVendor); |
+ } |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingGLRenderer)) { |
+ gl_renderer_ = |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLRenderer); |
+ } |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingGLVersion)) { |
+ gl_version_ = |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVersion); |
+ } |
+ |
if (!gl_vendor_.empty() || !gl_renderer_.empty() || !gl_version_.empty()) { |
content::GpuDataManager::GetInstance()->SetGLStrings( |
gl_vendor_, gl_renderer_, gl_version_); |