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

Unified Diff: gpu/config/gpu_info_collector.cc

Issue 1548893004: Allow WebGL readback for Mesa llvmpipe driver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only allow WebGL feature Created 4 years, 8 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..e24e93d3a79c6c05977c91aa2ce2e1b34a70d086 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"
@@ -118,8 +120,23 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
gpu_info->gl_renderer = GetGLString(GL_RENDERER);
gpu_info->gl_vendor = GetGLString(GL_VENDOR);
- gpu_info->gl_extensions = gfx::GetGLExtensionsFromCurrentContext();
gpu_info->gl_version = GetGLString(GL_VERSION);
+
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kGpuTestingGLVendor)) {
+ gpu_info->gl_vendor =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVendor);
+ }
+ if (command_line->HasSwitch(switches::kGpuTestingGLRenderer)) {
+ gpu_info->gl_renderer =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLRenderer);
+ }
+ if (command_line->HasSwitch(switches::kGpuTestingGLVersion)) {
+ gpu_info->gl_version =
+ command_line->GetSwitchValueASCII(switches::kGpuTestingGLVersion);
+ }
+
+ gpu_info->gl_extensions = gfx::GetGLExtensionsFromCurrentContext();
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