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..a7c50feb8ad1c5742574622deebfb0e8752cd15f 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" |
@@ -270,5 +272,22 @@ void IdentifyActiveGPU(GPUInfo* gpu_info) { |
} |
} |
+void ParseTestingIds(uint32_t* vendor_id, uint32_t* device_id) { |
+ DCHECK(vendor_id); |
+ DCHECK(device_id); |
Zhenyao Mo
2016/01/29 22:40:35
Set them to 0 by default.
|
+ |
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingVendorId)) |
+ base::HexStringToUInt( |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), |
+ vendor_id); |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingDeviceId)) |
+ base::HexStringToUInt( |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingDeviceId), |
+ device_id); |
+} |
+ |
} // namespace gpu |