| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 212 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 197 | 213 |
| 198 if (command_line.HasSwitch(switches::kDisableMapImage)) | 214 if (command_line.HasSwitch(switches::kDisableMapImage)) |
| 199 return false; | 215 return false; |
| 200 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 216 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
| 201 return true; | 217 return true; |
| 202 | 218 |
| 203 return false; | 219 return false; |
| 204 } | 220 } |
| 205 | 221 |
| 222 bool IsStartCommitBeforeDrawEnabled() { |
| 223 // Starting the commit before activation implies starting the commit |
| 224 // before draw as well. |
| 225 if (IsStartCommitBeforeActivateEnabled()) |
| 226 return true; |
| 227 |
| 228 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 229 |
| 230 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeDraw)) |
| 231 return false; |
| 232 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeDraw)) |
| 233 return true; |
| 234 |
| 235 return true; |
| 236 } |
| 237 |
| 238 bool IsStartCommitBeforeActivateEnabled() { |
| 239 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 240 |
| 241 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeActivate)) |
| 242 return false; |
| 243 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeActivate)) |
| 244 return true; |
| 245 |
| 246 return false; |
| 247 } |
| 248 |
| 206 } // namespace switches | 249 } // namespace switches |
| 207 } // namespace cc | 250 } // namespace cc |
| OLD | NEW |