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/switches.h" | 5 #include "cc/switches.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 namespace switches { | 8 namespace switches { |
9 | 9 |
10 // On platforms where checkerboards are used, prefer background colors instead | 10 // On platforms where checkerboards are used, prefer background colors instead |
11 // of checkerboards. | 11 // of checkerboards. |
12 const char kBackgroundColorInsteadOfCheckerboard[] = | 12 const char kBackgroundColorInsteadOfCheckerboard[] = |
13 "background-color-instead-of-checkerboard"; | 13 "background-color-instead-of-checkerboard"; |
14 | 14 |
15 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; | 15 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; |
16 | 16 |
17 // Send a message for every frame from the impl thread to the parent compositor. | 17 // Send a message for every frame from the impl thread to the parent compositor. |
18 const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message"; | 18 const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message"; |
19 | 19 |
| 20 // Paint content on the main thread instead of the compositor thread. |
| 21 // Overrides the kEnableImplSidePainting flag. |
| 22 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; |
| 23 |
20 // Paint content on the compositor thread instead of the main thread. | 24 // Paint content on the compositor thread instead of the main thread. |
21 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | 25 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
22 | 26 |
23 const char kEnablePartialSwap[] = "enable-partial-swap"; | 27 const char kEnablePartialSwap[] = "enable-partial-swap"; |
24 | 28 |
25 const char kEnablePerTilePainting[] = "enable-per-tile-painting"; | 29 const char kEnablePerTilePainting[] = "enable-per-tile-painting"; |
26 | 30 |
27 // Try to finish display pipeline before vsync tick | 31 // Try to finish display pipeline before vsync tick |
28 const char kEnableRightAlignedScheduling[] = "enable-right-aligned-scheduling"; | 32 const char kEnableRightAlignedScheduling[] = "enable-right-aligned-scheduling"; |
29 | 33 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const char kTraceAllRenderedFrames[] = "trace-all-rendered-frames"; | 71 const char kTraceAllRenderedFrames[] = "trace-all-rendered-frames"; |
68 | 72 |
69 // Re-rasters everything multiple times to simulate a much slower machine. | 73 // Re-rasters everything multiple times to simulate a much slower machine. |
70 // Give a scale factor to cause raster to take that many times longer to | 74 // Give a scale factor to cause raster to take that many times longer to |
71 // complete, such as --slow-down-raster-scale-factor=25. | 75 // complete, such as --slow-down-raster-scale-factor=25. |
72 const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor"; | 76 const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor"; |
73 | 77 |
74 // Schedule rasterization jobs according to their estimated processing cost. | 78 // Schedule rasterization jobs according to their estimated processing cost. |
75 const char kUseCheapnessEstimator[] = "use-cheapness-estimator"; | 79 const char kUseCheapnessEstimator[] = "use-cheapness-estimator"; |
76 | 80 |
| 81 bool IsImplSidePaintingEnabled() { |
| 82 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 83 |
| 84 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting)) |
| 85 return false; |
| 86 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting)) |
| 87 return true; |
| 88 |
| 89 #if defined(OS_ANDROID) |
| 90 return true; |
| 91 #else |
| 92 return false; |
| 93 #endif |
| 94 } |
| 95 |
77 } // namespace switches | 96 } // namespace switches |
78 } // namespace cc | 97 } // namespace cc |
OLD | NEW |