Index: cc/base/switches.cc |
diff --git a/cc/base/switches.cc b/cc/base/switches.cc |
old mode 100644 |
new mode 100755 |
index ddba9cbd4449b52cb8edd870a77dccc45faafb35..3b02c183d34e5034a39e6dfd93f43434289c83bd |
--- a/cc/base/switches.cc |
+++ b/cc/base/switches.cc |
@@ -5,6 +5,7 @@ |
#include "cc/base/switches.h" |
#include "base/command_line.h" |
+#include "base/strings/string_number_conversions.h" |
namespace cc { |
namespace switches { |
@@ -209,5 +210,23 @@ bool IsMapImageEnabled() { |
return false; |
} |
+size_t GetNumRasterThreads() { |
reveman
2013/12/22 15:49:25
You need to remove LayerTreeSettings::num_raster_t
|
+ const int kMinRasterThreads = 1; |
+ const int kMaxRasterThreads = 64; |
+ const int kDefaultNumRasterThreads = 1; |
+ |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ if (command_line.HasSwitch(switches::kNumRasterThreads)) { |
+ std::string string_value = |
+ command_line.GetSwitchValueASCII(switches::kNumRasterThreads); |
+ int num_threads; |
+ base::StringToInt(string_value, &num_threads); |
+ return std::max(kMinRasterThreads, |
+ std::min(num_threads, kMaxRasterThreads)); |
reveman
2013/12/22 15:49:25
This is different from the parsing of this value i
|
+ } else { |
reveman
2013/12/22 15:49:25
nit: style guide prefers no "else" if you return a
|
+ return kDefaultNumRasterThreads; |
+ } |
+} |
+ |
} // namespace switches |
} // namespace cc |