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

Unified Diff: gpu/config/gpu_info_collector.cc

Issue 1547793004: Make gpu black list work again on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: gpu/config/gpu_info_collector.cc
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 44df9f1550b2b73ed58c3bc6b994130cbaca8498..fcee563761f897f0d1ad598f876fa9a3a3430a4a 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/sparse_histogram.h"
@@ -18,6 +19,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
+#include "gpu/config/gpu_switches.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
@@ -116,10 +118,28 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
return kCollectInfoFatalFailure;
}
- gpu_info->gl_renderer = GetGLString(GL_RENDERER);
- gpu_info->gl_vendor = GetGLString(GL_VENDOR);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+
+ if (command_line->HasSwitch(switches::kGpuTestingGLRenderer))
+ gpu_info->gl_renderer =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLRenderer);
+ else
+ gpu_info->gl_renderer = GetGLString(GL_RENDERER);
+
+ if (command_line->HasSwitch(switches::kGpuTestingGLVendor))
+ gpu_info->gl_vendor =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVendor);
+ else
+ gpu_info->gl_vendor = GetGLString(GL_VENDOR);
+
gpu_info->gl_extensions = gfx::GetGLExtensionsFromCurrentContext();
- gpu_info->gl_version = GetGLString(GL_VERSION);
+
+ if (command_line->HasSwitch(switches::kGpuTestingGLVersion))
+ gpu_info->gl_version =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVersion);
+ else
+ gpu_info->gl_version =
+ GetGLString(GL_VERSION); // driver vendor driver version
std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION);
gfx::GLVersionInfo gl_info(gpu_info->gl_version.c_str(),

Powered by Google App Engine
This is Rietveld 408576698