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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Allow heuristics to determine when a layer tile should be drawn with | 39 // Allow heuristics to determine when a layer tile should be drawn with |
40 // the Skia GPU backend. Only valid with GPU accelerated compositing + | 40 // the Skia GPU backend. Only valid with GPU accelerated compositing + |
41 // impl-side painting. | 41 // impl-side painting. |
42 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; | 42 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; |
43 | 43 |
44 // Disable GPU rasterization, i.e. rasterize on the CPU only. | 44 // Disable GPU rasterization, i.e. rasterize on the CPU only. |
45 // Overrides the kEnableGPURasterization flag. | 45 // Overrides the kEnableGPURasterization flag. |
46 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; | 46 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; |
47 | 47 |
| 48 // When using CPU rasterizing generate low resolution tiling. Low res |
| 49 // tiles may be displayed during fast scrolls especially on slower devices. |
| 50 const char kEnableLowResTiling[] = "enable-low-res-tiling"; |
| 51 |
| 52 // When using CPU rasterizing disable low resolution tiling. This uses |
| 53 // less power, particularly during animations, but more white may be seen |
| 54 // during fast scrolling especially on slower devices. |
| 55 const char kDisableLowResTiling[] = "disable-low-res-tiling"; |
| 56 |
48 // The height of the movable top controls. | 57 // The height of the movable top controls. |
49 const char kTopControlsHeight[] = "top-controls-height"; | 58 const char kTopControlsHeight[] = "top-controls-height"; |
50 | 59 |
51 // Percentage of the top controls need to be hidden before they will auto hide. | 60 // Percentage of the top controls need to be hidden before they will auto hide. |
52 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; | 61 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; |
53 | 62 |
54 // Percentage of the top controls need to be shown before they will auto show. | 63 // Percentage of the top controls need to be shown before they will auto show. |
55 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; | 64 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; |
56 | 65 |
57 // Show metrics about overdraw in about:tracing recordings, such as the number | 66 // Show metrics about overdraw in about:tracing recordings, such as the number |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 178 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
170 | 179 |
171 if (command_line.HasSwitch(switches::kDisableGPURasterization)) | 180 if (command_line.HasSwitch(switches::kDisableGPURasterization)) |
172 return false; | 181 return false; |
173 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) | 182 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) |
174 return true; | 183 return true; |
175 | 184 |
176 return false; | 185 return false; |
177 } | 186 } |
178 | 187 |
| 188 bool IsLowResTilingEnabled() { |
| 189 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 190 |
| 191 if (command_line.HasSwitch(switches::kDisableLowResTiling)) |
| 192 return false; |
| 193 else if (command_line.HasSwitch(switches::kEnableLowResTiling)) |
| 194 return true; |
| 195 |
| 196 return true; |
| 197 } |
| 198 |
179 bool IsImplSidePaintingEnabled() { | 199 bool IsImplSidePaintingEnabled() { |
180 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 200 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
181 | 201 |
182 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) | 202 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) |
183 return false; | 203 return false; |
184 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) | 204 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) |
185 return true; | 205 return true; |
186 | 206 |
187 #if defined(OS_ANDROID) | 207 #if defined(OS_ANDROID) |
188 return true; | 208 return true; |
189 #else | 209 #else |
190 return false; | 210 return false; |
191 #endif | 211 #endif |
192 } | 212 } |
193 | 213 |
194 bool IsMapImageEnabled() { | 214 bool IsMapImageEnabled() { |
195 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 215 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
196 | 216 |
197 if (command_line.HasSwitch(switches::kDisableMapImage)) | 217 if (command_line.HasSwitch(switches::kDisableMapImage)) |
198 return false; | 218 return false; |
199 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 219 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
200 return true; | 220 return true; |
201 | 221 |
202 return false; | 222 return false; |
203 } | 223 } |
204 | 224 |
205 } // namespace switches | 225 } // namespace switches |
206 } // namespace cc | 226 } // namespace cc |
OLD | NEW |