Index: cc/base/switches.cc |
diff --git a/cc/base/switches.cc b/cc/base/switches.cc |
old mode 100644 |
new mode 100755 |
index be4a2c55adfbcb22214a0a92439f59da8fd112e2..ac0982244e1e4f12d28d61635fee9f1d1b0c921a |
--- 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 { |
@@ -198,5 +199,16 @@ bool IsMapImageEnabled() { |
return false; |
} |
+int GetNumRasterThreads() { |
reveman
2013/11/21 16:36:10
nit: indent 2 spaces not 4
reveman
2013/11/21 16:36:10
return size_t instead of int?
|
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ std::string string_value = |
+ command_line.GetSwitchValueASCII(cc::switches::kNumRasterThreads); |
vivekg
2013/11/21 17:18:12
In case kNumRasterThreads command line switch is n
reveman
2013/11/21 17:30:02
Yes, please add a command_line.HasSwitch check and
|
+ int num_threads; |
+ base::StringToInt(string_value, &num_threads); |
+ if (num_threads == 0) |
+ num_threads = 1; // Min num of threads |
reveman
2013/11/21 16:36:10
we should also put a limit on the max number of th
|
+ return num_threads; |
+} |
+ |
} // namespace switches |
} // namespace cc |