Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/base/switches.h" | 5 #include "cc/base/switches.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | |
| 8 | 9 |
| 9 namespace cc { | 10 namespace cc { |
| 10 namespace switches { | 11 namespace switches { |
| 11 | 12 |
| 12 // On platforms where checkerboards are used, prefer background colors instead | 13 // On platforms where checkerboards are used, prefer background colors instead |
| 13 // of checkerboards. | 14 // of checkerboards. |
| 14 const char kBackgroundColorInsteadOfCheckerboard[] = | 15 const char kBackgroundColorInsteadOfCheckerboard[] = |
| 15 "background-color-instead-of-checkerboard"; | 16 "background-color-instead-of-checkerboard"; |
| 16 | 17 |
| 17 // Disables LCD text. | 18 // Disables LCD text. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 192 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 192 | 193 |
| 193 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) | 194 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) |
| 194 return false; | 195 return false; |
| 195 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) | 196 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) |
| 196 return true; | 197 return true; |
| 197 | 198 |
| 198 return false; | 199 return false; |
| 199 } | 200 } |
| 200 | 201 |
| 202 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?
| |
| 203 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 204 std::string string_value = | |
| 205 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
| |
| 206 int num_threads; | |
| 207 base::StringToInt(string_value, &num_threads); | |
| 208 if (num_threads == 0) | |
| 209 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
| |
| 210 return num_threads; | |
| 211 } | |
| 212 | |
| 201 } // namespace switches | 213 } // namespace switches |
| 202 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |