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

Unified Diff: gpu/config/gpu_util.cc

Issue 16159004: Hookup driver_bug_workarounds with gl_tests properly. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_util.cc
===================================================================
--- gpu/config/gpu_util.cc (revision 202179)
+++ gpu/config/gpu_util.cc (working copy)
@@ -6,11 +6,33 @@
#include <vector>
+#include "base/command_line.h"
#include "base/logging.h"
+#include "base/strings/string_number_conversions.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
+#include "gpu/config/gpu_control_list_jsons.h"
+#include "gpu/config/gpu_driver_bug_list.h"
+#include "gpu/config/gpu_info_collector.h"
#include "ui/gl/gl_switches.h"
namespace gpu {
+namespace {
+
+// Combine the integers into a string, seperated by ','.
+std::string IntSetToString(const std::set<int>& list) {
+ std::string rt;
+ for (std::set<int>::const_iterator it = list.begin();
+ it != list.end(); ++it) {
+ if (!rt.empty())
+ rt += ",";
+ rt += base::IntToString(*it);
+ }
+ return rt;
+}
+
+} // namespace anonymous
+
GpuSwitchingOption StringToGpuSwitchingOption(
const std::string& switching_string) {
if (switching_string == switches::kGpuSwitchingOptionNameAutomatic)
@@ -42,4 +64,19 @@
dst->insert(src.begin(), src.end());
}
+void ApplyGpuDriverBugWorkarounds(CommandLine* command_line) {
+ GPUInfo gpu_info;
+ CollectBasicGraphicsInfo(&gpu_info);
+
+ GpuDriverBugList* list = GpuDriverBugList::Create();
+ list->LoadList("0", kGpuDriverBugListJson,
+ GpuControlList::kCurrentOsOnly);
+ std::set<int> workarounds = list->MakeDecision(
+ GpuControlList::kOsAny, std::string(), gpu_info);
+ if (!workarounds.empty()) {
+ command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
+ IntSetToString(workarounds));
+ }
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698