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

Unified Diff: gpu/config/gpu_util.cc

Issue 57633007: Merge gpu_switching_list into gpu_driver_bug_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final final Created 7 years, 1 month 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') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_util.cc
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 7fae88a52163a755fecf60b62951b6168ae33f8b..728546c1b59ea2a77ce1636aa9c935fa048a1b3d 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_split.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"
@@ -31,32 +32,20 @@ std::string IntSetToString(const std::set<int>& list) {
return rt;
}
-} // namespace anonymous
-
-GpuSwitchingOption StringToGpuSwitchingOption(
- const std::string& switching_string) {
- if (switching_string == switches::kGpuSwitchingOptionNameAutomatic)
- return GPU_SWITCHING_OPTION_AUTOMATIC;
- if (switching_string == switches::kGpuSwitchingOptionNameForceIntegrated)
- return GPU_SWITCHING_OPTION_FORCE_INTEGRATED;
- if (switching_string == switches::kGpuSwitchingOptionNameForceDiscrete)
- return GPU_SWITCHING_OPTION_FORCE_DISCRETE;
- return GPU_SWITCHING_OPTION_UNKNOWN;
-}
-
-std::string GpuSwitchingOptionToString(GpuSwitchingOption option) {
- switch (option) {
- case GPU_SWITCHING_OPTION_AUTOMATIC:
- return switches::kGpuSwitchingOptionNameAutomatic;
- case GPU_SWITCHING_OPTION_FORCE_INTEGRATED:
- return switches::kGpuSwitchingOptionNameForceIntegrated;
- case GPU_SWITCHING_OPTION_FORCE_DISCRETE:
- return switches::kGpuSwitchingOptionNameForceDiscrete;
- default:
- return "unknown";
+void StringToIntSet(const std::string& str, std::set<int>* list) {
+ DCHECK(list);
+ std::vector<std::string> pieces;
+ base::SplitString(str, ',', &pieces);
+ for (size_t i = 0; i < pieces.size(); ++i) {
+ int number = 0;
+ bool succeed = base::StringToInt(pieces[i], &number);
+ DCHECK(succeed);
+ list->insert(number);
}
}
+} // namespace anonymous
+
void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) {
DCHECK(dst);
if (src.empty())
@@ -79,4 +68,9 @@ void ApplyGpuDriverBugWorkarounds(CommandLine* command_line) {
}
}
+void StringToFeatureSet(
+ const std::string& str, std::set<int>* feature_set) {
+ StringToIntSet(str, feature_set);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_util.h ('k') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698