| 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 // Always use the Skia GPU backend for drawing layer tiles. Only valid with |
| 45 // GPU accelerated compositing + impl-side painting. Overrides the |
| 46 // kEnableGPURasterization flag. |
| 47 const char kEnableUniversalGPURasterization[] = |
| 48 "enable-universal-gpu-rasterization"; |
| 49 |
| 44 // Disable GPU rasterization, i.e. rasterize on the CPU only. | 50 // Disable GPU rasterization, i.e. rasterize on the CPU only. |
| 45 // Overrides the kEnableGPURasterization flag. | 51 // Overrides the kEnableGPURasterization and kEnableUniversalGPURasterization |
| 52 // flags. |
| 46 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; | 53 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; |
| 47 | 54 |
| 48 // The height of the movable top controls. | 55 // The height of the movable top controls. |
| 49 const char kTopControlsHeight[] = "top-controls-height"; | 56 const char kTopControlsHeight[] = "top-controls-height"; |
| 50 | 57 |
| 51 // Percentage of the top controls need to be hidden before they will auto hide. | 58 // Percentage of the top controls need to be hidden before they will auto hide. |
| 52 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; | 59 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; |
| 53 | 60 |
| 54 // Percentage of the top controls need to be shown before they will auto show. | 61 // Percentage of the top controls need to be shown before they will auto show. |
| 55 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; | 62 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 else if (command_line->HasSwitch(switches::kEnableLCDText)) | 165 else if (command_line->HasSwitch(switches::kEnableLCDText)) |
| 159 return true; | 166 return true; |
| 160 | 167 |
| 161 #if defined(OS_ANDROID) | 168 #if defined(OS_ANDROID) |
| 162 return false; | 169 return false; |
| 163 #else | 170 #else |
| 164 return true; | 171 return true; |
| 165 #endif | 172 #endif |
| 166 } | 173 } |
| 167 | 174 |
| 168 bool IsGpuRasterizationEnabled() { | 175 bool IsHybridGpuRasterizationEnabled() { |
| 169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 176 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 170 | 177 |
| 171 if (command_line.HasSwitch(switches::kDisableGPURasterization)) | 178 if (command_line.HasSwitch(switches::kDisableGPURasterization)) |
| 172 return false; | 179 return false; |
| 173 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) | 180 |
| 181 if (command_line.HasSwitch(switches::kEnableUniversalGPURasterization)) |
| 182 return false; |
| 183 |
| 184 if (command_line.HasSwitch(switches::kEnableGPURasterization)) |
| 174 return true; | 185 return true; |
| 175 | 186 |
| 176 return false; | 187 return false; |
| 188 } |
| 189 |
| 190 bool IsUniversalGpuRasterizationEnabled() { |
| 191 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 192 |
| 193 if (command_line.HasSwitch(switches::kDisableGPURasterization)) |
| 194 return false; |
| 195 |
| 196 if (command_line.HasSwitch(switches::kEnableUniversalGPURasterization)) |
| 197 return true; |
| 198 |
| 199 return false; |
| 177 } | 200 } |
| 178 | 201 |
| 179 bool IsImplSidePaintingEnabled() { | 202 bool IsImplSidePaintingEnabled() { |
| 180 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 203 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 181 | 204 |
| 182 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) | 205 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) |
| 183 return false; | 206 return false; |
| 184 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) | 207 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) |
| 185 return true; | 208 return true; |
| 186 | 209 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 197 if (command_line.HasSwitch(switches::kDisableMapImage)) | 220 if (command_line.HasSwitch(switches::kDisableMapImage)) |
| 198 return false; | 221 return false; |
| 199 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 222 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
| 200 return true; | 223 return true; |
| 201 | 224 |
| 202 return false; | 225 return false; |
| 203 } | 226 } |
| 204 | 227 |
| 205 } // namespace switches | 228 } // namespace switches |
| 206 } // namespace cc | 229 } // namespace cc |
| OLD | NEW |