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 | 8 |
9 namespace cc { | 9 namespace cc { |
10 namespace switches { | 10 namespace switches { |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Paint content on the main thread instead of the compositor thread. | 26 // Paint content on the main thread instead of the compositor thread. |
27 // Overrides the kEnableImplSidePainting flag. | 27 // Overrides the kEnableImplSidePainting flag. |
28 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; | 28 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; |
29 | 29 |
30 // Enables LCD text. | 30 // Enables LCD text. |
31 const char kEnableLCDText[] = "enable-lcd-text"; | 31 const char kEnableLCDText[] = "enable-lcd-text"; |
32 | 32 |
33 // Paint content on the compositor thread instead of the main thread. | 33 // Paint content on the compositor thread instead of the main thread. |
34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | 34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
35 | 35 |
| 36 // Disables the starting the next commit before the previous commit has drawn. |
| 37 // Overrides the kEnableStartCommitBeforeDraw flag. |
| 38 const char kDisableStartCommitBeforeDraw[] = "disable-start-commit-before-draw"; |
| 39 |
| 40 // Allows the next commit to start before the previous commit has drawn. |
| 41 const char kEnableStartCommitBeforeDraw[] = "enable-start-commit-before-draw"; |
| 42 |
| 43 // Disables the starting the next commit before the previous commit activates. |
| 44 // Overrides the kEnableStartCommitBeforeDraw flag. |
| 45 const char kDisableStartCommitBeforeActivate[] = |
| 46 "disable-start-commit-before-activate"; |
| 47 |
| 48 // Allows the next commit to start before the previous commit activates. |
| 49 const char kEnableStartCommitBeforeActivate[] = |
| 50 "enable-start-commit-before-activate"; |
| 51 |
36 const char kEnableTopControlsPositionCalculation[] = | 52 const char kEnableTopControlsPositionCalculation[] = |
37 "enable-top-controls-position-calculation"; | 53 "enable-top-controls-position-calculation"; |
38 | 54 |
39 // Allow heuristics to determine when a layer tile should be drawn with | 55 // Allow heuristics to determine when a layer tile should be drawn with |
40 // the Skia GPU backend. Only valid with GPU accelerated compositing + | 56 // the Skia GPU backend. Only valid with GPU accelerated compositing + |
41 // impl-side painting. | 57 // impl-side painting. |
42 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; | 58 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; |
43 | 59 |
44 // Disable GPU rasterization, i.e. rasterize on the CPU only. | 60 // Disable GPU rasterization, i.e. rasterize on the CPU only. |
45 // Overrides the kEnableGPURasterization flag. | 61 // Overrides the kEnableGPURasterization flag. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 215 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
200 | 216 |
201 if (command_line.HasSwitch(switches::kDisableMapImage)) | 217 if (command_line.HasSwitch(switches::kDisableMapImage)) |
202 return false; | 218 return false; |
203 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 219 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
204 return true; | 220 return true; |
205 | 221 |
206 return false; | 222 return false; |
207 } | 223 } |
208 | 224 |
| 225 bool IsStartCommitBeforeDrawEnabled() { |
| 226 // Starting the commit before activation implies starting the commit |
| 227 // before draw as well. |
| 228 if (IsStartCommitBeforeActivateEnabled()) |
| 229 return true; |
| 230 |
| 231 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 232 |
| 233 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeDraw)) |
| 234 return false; |
| 235 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeDraw)) |
| 236 return true; |
| 237 |
| 238 return true; |
| 239 } |
| 240 |
| 241 bool IsStartCommitBeforeActivateEnabled() { |
| 242 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 243 |
| 244 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeActivate)) |
| 245 return false; |
| 246 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeActivate)) |
| 247 return true; |
| 248 |
| 249 return false; |
| 250 } |
| 251 |
209 } // namespace switches | 252 } // namespace switches |
210 } // namespace cc | 253 } // namespace cc |
OLD | NEW |