| 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 <string> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 | 10 |
| 9 namespace cc { | 11 namespace cc { |
| 10 namespace switches { | 12 namespace switches { |
| 11 | 13 |
| 12 // On platforms where checkerboards are used, prefer background colors instead | 14 // On platforms where checkerboards are used, prefer background colors instead |
| 13 // of checkerboards. | 15 // of checkerboards. |
| 14 const char kBackgroundColorInsteadOfCheckerboard[] = | 16 const char kBackgroundColorInsteadOfCheckerboard[] = |
| 15 "background-color-instead-of-checkerboard"; | 17 "background-color-instead-of-checkerboard"; |
| 16 | 18 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 29 | 31 |
| 30 // Enables LCD text. | 32 // Enables LCD text. |
| 31 const char kEnableLCDText[] = "enable-lcd-text"; | 33 const char kEnableLCDText[] = "enable-lcd-text"; |
| 32 | 34 |
| 33 // Paint content on the compositor thread instead of the main thread. | 35 // Paint content on the compositor thread instead of the main thread. |
| 34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | 36 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
| 35 | 37 |
| 36 const char kEnableTopControlsPositionCalculation[] = | 38 const char kEnableTopControlsPositionCalculation[] = |
| 37 "enable-top-controls-position-calculation"; | 39 "enable-top-controls-position-calculation"; |
| 38 | 40 |
| 39 // Allow heuristics to determine when a layer tile should be drawn with | 41 // Select the location used for drawing layer tiles. Allowed values are |
| 40 // the Skia GPU backend. Only valid with GPU accelerated compositing + | 42 // 'cpu' (rasterize on the CPU only), 'gpu' (always use the Skia GPU backend |
| 41 // impl-side painting. | 43 // for rasterization), and 'hybrid' (use hints and heuristics to determine |
| 42 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; | 44 // when to rasterize using the Skia GPU backend). |
| 43 | 45 const char kRasterizationSite[] = "rasterization-site"; |
| 44 // Disable GPU rasterization, i.e. rasterize on the CPU only. | |
| 45 // Overrides the kEnableGPURasterization flag. | |
| 46 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; | |
| 47 | 46 |
| 48 // The height of the movable top controls. | 47 // The height of the movable top controls. |
| 49 const char kTopControlsHeight[] = "top-controls-height"; | 48 const char kTopControlsHeight[] = "top-controls-height"; |
| 50 | 49 |
| 51 // Percentage of the top controls need to be hidden before they will auto hide. | 50 // Percentage of the top controls need to be hidden before they will auto hide. |
| 52 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; | 51 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; |
| 53 | 52 |
| 54 // Percentage of the top controls need to be shown before they will auto show. | 53 // Percentage of the top controls need to be shown before they will auto show. |
| 55 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; | 54 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; |
| 56 | 55 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 else if (command_line->HasSwitch(switches::kEnableLCDText)) | 157 else if (command_line->HasSwitch(switches::kEnableLCDText)) |
| 159 return true; | 158 return true; |
| 160 | 159 |
| 161 #if defined(OS_ANDROID) | 160 #if defined(OS_ANDROID) |
| 162 return false; | 161 return false; |
| 163 #else | 162 #else |
| 164 return true; | 163 return true; |
| 165 #endif | 164 #endif |
| 166 } | 165 } |
| 167 | 166 |
| 167 bool IsHybridRasterizationEnabled() { |
| 168 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 169 std::string rasterization_site = |
| 170 command_line.GetSwitchValueASCII(switches::kRasterizationSite); |
| 171 return rasterization_site == "hybrid"; |
| 172 } |
| 173 |
| 168 bool IsGpuRasterizationEnabled() { | 174 bool IsGpuRasterizationEnabled() { |
| 169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 175 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 170 | 176 std::string rasterization_site = |
| 171 if (command_line.HasSwitch(switches::kDisableGPURasterization)) | 177 command_line.GetSwitchValueASCII(switches::kRasterizationSite); |
| 172 return false; | 178 return rasterization_site == "gpu"; |
| 173 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) | |
| 174 return true; | |
| 175 | |
| 176 return false; | |
| 177 } | 179 } |
| 178 | 180 |
| 179 bool IsImplSidePaintingEnabled() { | 181 bool IsImplSidePaintingEnabled() { |
| 180 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 182 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 181 | 183 |
| 182 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) | 184 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) |
| 183 return false; | 185 return false; |
| 184 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) | 186 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) |
| 185 return true; | 187 return true; |
| 186 | 188 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 197 if (command_line.HasSwitch(switches::kDisableMapImage)) | 199 if (command_line.HasSwitch(switches::kDisableMapImage)) |
| 198 return false; | 200 return false; |
| 199 else if (command_line.HasSwitch(switches::kEnableMapImage)) | 201 else if (command_line.HasSwitch(switches::kEnableMapImage)) |
| 200 return true; | 202 return true; |
| 201 | 203 |
| 202 return false; | 204 return false; |
| 203 } | 205 } |
| 204 | 206 |
| 205 } // namespace switches | 207 } // namespace switches |
| 206 } // namespace cc | 208 } // namespace cc |
| OLD | NEW |