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 kDisableDeadlineScheduling flag. | |
enne (OOO)
2013/09/10 03:35:44
typo? s/Disable/Enable/
brianderson
2013/09/10 21:16:56
Done.
| |
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 164 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
155 | 165 |
156 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) | 166 if (command_line.HasSwitch(cc::switches::kDisableMapImage)) |
157 return false; | 167 return false; |
158 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) | 168 else if (command_line.HasSwitch(cc::switches::kEnableMapImage)) |
159 return true; | 169 return true; |
160 | 170 |
161 return false; | 171 return false; |
162 } | 172 } |
163 | 173 |
174 bool IsDeadlineSchedulingEnabled() { | |
175 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
176 | |
177 if (command_line.HasSwitch(cc::switches::kDisableDeadlineScheduling)) | |
178 return false; | |
179 else if (command_line.HasSwitch(cc::switches::kEnableDeadlineScheduling)) | |
180 return true; | |
181 | |
182 #if defined(OS_ANDROID) | |
183 return true; | |
184 #else | |
185 return false; | |
186 #endif | |
187 } | |
188 | |
164 } // namespace switches | 189 } // namespace switches |
165 } // namespace cc | 190 } // namespace cc |
OLD | NEW |