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 { |
11 | 11 |
12 // On platforms where checkerboards are used, prefer background colors instead | 12 // On platforms where checkerboards are used, prefer background colors instead |
13 // of checkerboards. | 13 // of checkerboards. |
14 const char kBackgroundColorInsteadOfCheckerboard[] = | 14 const char kBackgroundColorInsteadOfCheckerboard[] = |
15 "background-color-instead-of-checkerboard"; | 15 "background-color-instead-of-checkerboard"; |
16 | 16 |
17 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; | 17 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; |
18 | 18 |
19 // Disables layer-edge anti-aliasing in the compositor. | 19 // Disables layer-edge anti-aliasing in the compositor. |
20 const char kDisableCompositedAntialiasing[] = | 20 const char kDisableCompositedAntialiasing[] = |
21 "disable-composited-antialiasing"; | 21 "disable-composited-antialiasing"; |
22 | 22 |
23 // Paint content on the main thread instead of the compositor thread. | 23 // Paint content on the main thread instead of the compositor thread. |
24 // Overrides the kEnableImplSidePainting flag. | 24 // Overrides the kEnableImplSidePainting flag. |
25 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; | 25 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; |
26 | 26 |
27 // Paint content on the compositor thread instead of the main thread. | 27 // Paint content on the compositor thread instead of the main thread. |
28 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | 28 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
29 | 29 |
| 30 // Disables the deadline scheduler. |
| 31 // Overrides the kDisableDeadlineShceduling flag. |
| 32 const char kDisableDeadlineScheduling[] = "disable-deadline-scheduling"; |
| 33 |
| 34 // Deadline scheduling gives children compositors and the main thread an |
| 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 |
| 37 // of less than 1 vsync if their intervals are properly nested. |
| 38 const char kEnableDeadlineScheduling[] = "enable-deadline-scheduling"; |
| 39 |
30 const char kEnableTopControlsPositionCalculation[] = | 40 const char kEnableTopControlsPositionCalculation[] = |
31 "enable-top-controls-position-calculation"; | 41 "enable-top-controls-position-calculation"; |
32 | 42 |
33 // For any layers that can get drawn directly to screen, draw them with the Skia | 43 // For any layers that can get drawn directly to screen, draw them with the Skia |
34 // GPU backend. Only valid with gl rendering + threaded compositing + impl-side | 44 // GPU backend. Only valid with gl rendering + threaded compositing + impl-side |
35 // painting. | 45 // painting. |
36 const char kForceDirectLayerDrawing[] = "force-direct-layer-drawing"; | 46 const char kForceDirectLayerDrawing[] = "force-direct-layer-drawing"; |
37 | 47 |
38 // The height of the movable top controls. | 48 // The height of the movable top controls. |
39 const char kTopControlsHeight[] = "top-controls-height"; | 49 const char kTopControlsHeight[] = "top-controls-height"; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) | 149 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) |
140 return true; | 150 return true; |
141 | 151 |
142 #if defined(OS_ANDROID) | 152 #if defined(OS_ANDROID) |
143 return true; | 153 return true; |
144 #else | 154 #else |
145 return false; | 155 return false; |
146 #endif | 156 #endif |
147 } | 157 } |
148 | 158 |
| 159 bool IsDeadlineSchedulingEnabled() { |
| 160 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 161 |
| 162 if (command_line.HasSwitch(cc::switches::kDisableDeadlineScheduling)) |
| 163 return false; |
| 164 else if (command_line.HasSwitch(cc::switches::kEnableDeadlineScheduling)) |
| 165 return true; |
| 166 |
| 167 #if defined(OS_ANDROID) |
| 168 return true; |
| 169 #else |
| 170 return false; |
| 171 #endif |
| 172 } |
| 173 |
149 } // namespace switches | 174 } // namespace switches |
150 } // namespace cc | 175 } // namespace cc |
OLD | NEW |