| 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 19 matching lines...) Expand all Loading... |
| 30 // Disables the deadline scheduler. | 30 // Disables the deadline scheduler. |
| 31 // Overrides the kDisableDeadlineScheduling flag. | 31 // Overrides the kDisableDeadlineScheduling flag. |
| 32 const char kDisableDeadlineScheduling[] = "disable-deadline-scheduling"; | 32 const char kDisableDeadlineScheduling[] = "disable-deadline-scheduling"; |
| 33 | 33 |
| 34 // Deadline scheduling gives children compositors and the main thread an | 34 // Deadline scheduling gives children compositors and the main thread an |
| 35 // interval over which they can produce content instead of always consuming | 35 // interval over which they can produce content instead of always consuming |
| 36 // their input on the next BeginFrame. This allows a total pipeline latency | 36 // their input on the next BeginFrame. This allows a total pipeline latency |
| 37 // of less than 1 vsync if their intervals are properly nested. | 37 // of less than 1 vsync if their intervals are properly nested. |
| 38 const char kEnableDeadlineScheduling[] = "enable-deadline-scheduling"; | 38 const char kEnableDeadlineScheduling[] = "enable-deadline-scheduling"; |
| 39 | 39 |
| 40 // Disables the starting the next commit before the previous commit has drawn. |
| 41 // Overrides the kEnableStartCommitBeforeDraw flag. |
| 42 const char kDisableStartCommitBeforeDraw[] = "disable-start-commit-before-draw"; |
| 43 |
| 44 // Allows the next commit to start before the previous commit has drawn. |
| 45 const char kEnableStartCommitBeforeDraw[] = "enable-start-commit-before-draw"; |
| 46 |
| 47 // Disables the starting the next commit before the previous commit activates. |
| 48 // Overrides the kEnableStartCommitBeforeDraw flag. |
| 49 const char kDisableStartCommitBeforeActivate[] = |
| 50 "disable-start-commit-before-activate"; |
| 51 |
| 52 // Allows the next commit to start before the previous commit activates. |
| 53 const char kEnableStartCommitBeforeActivate[] = |
| 54 "enable-start-commit-before-activate"; |
| 55 |
| 40 const char kEnableTopControlsPositionCalculation[] = | 56 const char kEnableTopControlsPositionCalculation[] = |
| 41 "enable-top-controls-position-calculation"; | 57 "enable-top-controls-position-calculation"; |
| 42 | 58 |
| 43 // For any layers that can get drawn directly to screen, draw them with the Skia | 59 // For any layers that can get drawn directly to screen, draw them with the Skia |
| 44 // GPU backend. Only valid with gl rendering + threaded compositing + impl-side | 60 // GPU backend. Only valid with gl rendering + threaded compositing + impl-side |
| 45 // painting. | 61 // painting. |
| 46 const char kForceDirectLayerDrawing[] = "force-direct-layer-drawing"; | 62 const char kForceDirectLayerDrawing[] = "force-direct-layer-drawing"; |
| 47 | 63 |
| 48 // The height of the movable top controls. | 64 // The height of the movable top controls. |
| 49 const char kTopControlsHeight[] = "top-controls-height"; | 65 const char kTopControlsHeight[] = "top-controls-height"; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 else if (command_line.HasSwitch(cc::switches::kEnableDeadlineScheduling)) | 195 else if (command_line.HasSwitch(cc::switches::kEnableDeadlineScheduling)) |
| 180 return true; | 196 return true; |
| 181 | 197 |
| 182 #if defined(OS_ANDROID) | 198 #if defined(OS_ANDROID) |
| 183 return true; | 199 return true; |
| 184 #else | 200 #else |
| 185 return false; | 201 return false; |
| 186 #endif | 202 #endif |
| 187 } | 203 } |
| 188 | 204 |
| 205 bool IsStartCommitBeforeDrawEnabled() { |
| 206 // Starting the commit before activation implies starting the commit |
| 207 // before draw as well. |
| 208 if (IsStartCommitBeforeActivateEnabled()) |
| 209 return true; |
| 210 |
| 211 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 212 |
| 213 if (command_line.HasSwitch(cc::switches::kDisableStartCommitBeforeDraw)) |
| 214 return false; |
| 215 else if (command_line.HasSwitch(cc::switches::kEnableStartCommitBeforeDraw)) |
| 216 return true; |
| 217 |
| 218 #if defined(OS_ANDROID) |
| 219 return true; |
| 220 #else |
| 221 return false; |
| 222 #endif |
| 223 } |
| 224 |
| 225 bool IsStartCommitBeforeActivateEnabled() { |
| 226 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 227 |
| 228 if (command_line.HasSwitch(cc::switches::kDisableStartCommitBeforeActivate)) |
| 229 return false; |
| 230 else if ( |
| 231 command_line.HasSwitch(cc::switches::kEnableStartCommitBeforeActivate)) |
| 232 return true; |
| 233 |
| 234 #if defined(OS_ANDROID) |
| 235 return true; |
| 236 #else |
| 237 return false; |
| 238 #endif |
| 239 } |
| 240 |
| 189 } // namespace switches | 241 } // namespace switches |
| 190 } // namespace cc | 242 } // namespace cc |
| OLD | NEW |