| 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 23 matching lines...) Expand all Loading... |
| 34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | 34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
| 35 | 35 |
| 36 const char kEnableTopControlsPositionCalculation[] = | 36 const char kEnableTopControlsPositionCalculation[] = |
| 37 "enable-top-controls-position-calculation"; | 37 "enable-top-controls-position-calculation"; |
| 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. |
| 45 // Overrides the kEnableGPURasterization flag. |
| 46 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; |
| 47 |
| 44 // The height of the movable top controls. | 48 // The height of the movable top controls. |
| 45 const char kTopControlsHeight[] = "top-controls-height"; | 49 const char kTopControlsHeight[] = "top-controls-height"; |
| 46 | 50 |
| 47 // Percentage of the top controls need to be hidden before they will auto hide. | 51 // Percentage of the top controls need to be hidden before they will auto hide. |
| 48 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; | 52 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; |
| 49 | 53 |
| 50 // Percentage of the top controls need to be shown before they will auto show. | 54 // Percentage of the top controls need to be shown before they will auto show. |
| 51 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; | 55 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; |
| 52 | 56 |
| 53 // Number of worker threads used to rasterize content. | 57 // Number of worker threads used to rasterize content. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 else if (command_line->HasSwitch(switches::kEnableLCDText)) | 162 else if (command_line->HasSwitch(switches::kEnableLCDText)) |
| 159 return true; | 163 return true; |
| 160 | 164 |
| 161 #if defined(OS_ANDROID) | 165 #if defined(OS_ANDROID) |
| 162 return false; | 166 return false; |
| 163 #else | 167 #else |
| 164 return true; | 168 return true; |
| 165 #endif | 169 #endif |
| 166 } | 170 } |
| 167 | 171 |
| 172 bool IsGpuRasterizationEnabled() { |
| 173 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 174 |
| 175 if (command_line.HasSwitch(switches::kDisableGPURasterization)) |
| 176 return false; |
| 177 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) |
| 178 return true; |
| 179 |
| 180 return false; |
| 181 } |
| 182 |
| 168 bool IsImplSidePaintingEnabled() { | 183 bool IsImplSidePaintingEnabled() { |
| 169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 184 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 170 | 185 |
| 171 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) | 186 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) |
| 172 return false; | 187 return false; |
| 173 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) | 188 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) |
| 174 return true; | 189 return true; |
| 175 | 190 |
| 176 #if defined(OS_ANDROID) | 191 #if defined(OS_ANDROID) |
| 177 return true; | 192 return true; |
| 178 #else | 193 #else |
| 179 return false; | 194 return false; |
| 180 #endif | 195 #endif |
| 181 } | 196 } |
| 182 | 197 |
| 183 bool IsMapImageEnabled() { | 198 bool IsMapImageEnabled() { |
| 184 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 199 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 185 | 200 |
| 186 if (command_line.HasSwitch(switches::kDisableMapImage)) | 201 if (command_line.HasSwitch(switches::kDisableMapImage)) |
| 187 return false; | 202 return false; |
| 188 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 203 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
| 189 return true; | 204 return true; |
| 190 | 205 |
| 191 return false; | 206 return false; |
| 192 } | 207 } |
| 193 | 208 |
| 194 } // namespace switches | 209 } // namespace switches |
| 195 } // namespace cc | 210 } // namespace cc |
| OLD | NEW |