| 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 { |
| 11 | 11 |
| 12 // Disables LCD text. | |
| 13 const char kDisableLCDText[] = "disable-lcd-text"; | |
| 14 | |
| 15 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; | 12 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; |
| 16 | 13 |
| 17 // Disables layer-edge anti-aliasing in the compositor. | 14 // Disables layer-edge anti-aliasing in the compositor. |
| 18 const char kDisableCompositedAntialiasing[] = | 15 const char kDisableCompositedAntialiasing[] = |
| 19 "disable-composited-antialiasing"; | 16 "disable-composited-antialiasing"; |
| 20 | 17 |
| 21 // Paint content on the main thread instead of the compositor thread. | |
| 22 // Overrides the kEnableImplSidePainting flag. | |
| 23 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; | |
| 24 | |
| 25 // Enables LCD text. | |
| 26 const char kEnableLCDText[] = "enable-lcd-text"; | |
| 27 | |
| 28 // Paint content on the compositor thread instead of the main thread. | |
| 29 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; | |
| 30 | |
| 31 const char kEnableTopControlsPositionCalculation[] = | 18 const char kEnableTopControlsPositionCalculation[] = |
| 32 "enable-top-controls-position-calculation"; | 19 "enable-top-controls-position-calculation"; |
| 33 | 20 |
| 34 // Allow heuristics to determine when a layer tile should be drawn with | |
| 35 // the Skia GPU backend. Only valid with GPU accelerated compositing + | |
| 36 // impl-side painting. | |
| 37 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; | |
| 38 | |
| 39 // Disable GPU rasterization, i.e. rasterize on the CPU only. | |
| 40 // Overrides the kEnableGPURasterization flag. | |
| 41 const char kDisableGPURasterization[] = "disable-gpu-rasterization"; | |
| 42 | |
| 43 // The height of the movable top controls. | 21 // The height of the movable top controls. |
| 44 const char kTopControlsHeight[] = "top-controls-height"; | 22 const char kTopControlsHeight[] = "top-controls-height"; |
| 45 | 23 |
| 46 // Percentage of the top controls need to be hidden before they will auto hide. | 24 // Percentage of the top controls need to be hidden before they will auto hide. |
| 47 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; | 25 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; |
| 48 | 26 |
| 49 // Percentage of the top controls need to be shown before they will auto show. | 27 // Percentage of the top controls need to be shown before they will auto show. |
| 50 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; | 28 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; |
| 51 | 29 |
| 52 // Show metrics about overdraw in about:tracing recordings, such as the number | 30 // Show metrics about overdraw in about:tracing recordings, such as the number |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Show rects in the HUD wherever something is known to be drawn opaque and is | 97 // Show rects in the HUD wherever something is known to be drawn opaque and is |
| 120 // considered occluding the pixels behind it. | 98 // considered occluding the pixels behind it. |
| 121 const char kShowOccludingRects[] = "show-occluding-rects"; | 99 const char kShowOccludingRects[] = "show-occluding-rects"; |
| 122 const char kUIShowOccludingRects[] = "ui-show-occluding-rects"; | 100 const char kUIShowOccludingRects[] = "ui-show-occluding-rects"; |
| 123 | 101 |
| 124 // Show rects in the HUD wherever something is not known to be drawn opaque and | 102 // Show rects in the HUD wherever something is not known to be drawn opaque and |
| 125 // is not considered to be occluding the pixels behind it. | 103 // is not considered to be occluding the pixels behind it. |
| 126 const char kShowNonOccludingRects[] = "show-nonoccluding-rects"; | 104 const char kShowNonOccludingRects[] = "show-nonoccluding-rects"; |
| 127 const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects"; | 105 const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects"; |
| 128 | 106 |
| 129 // Enable rasterizer that writes directly to GPU memory. | |
| 130 const char kEnableMapImage[] = "enable-map-image"; | |
| 131 | |
| 132 // Disable rasterizer that writes directly to GPU memory. | |
| 133 // Overrides the kEnableMapImage flag. | |
| 134 const char kDisableMapImage[] = "disable-map-image"; | |
| 135 | |
| 136 // Prevents the layer tree unit tests from timing out. | 107 // Prevents the layer tree unit tests from timing out. |
| 137 const char kCCLayerTreeTestNoTimeout[] = "cc-layer-tree-test-no-timeout"; | 108 const char kCCLayerTreeTestNoTimeout[] = "cc-layer-tree-test-no-timeout"; |
| 138 | 109 |
| 139 // Makes pixel tests write their output instead of read it. | 110 // Makes pixel tests write their output instead of read it. |
| 140 const char kCCRebaselinePixeltests[] = "cc-rebaseline-pixeltests"; | 111 const char kCCRebaselinePixeltests[] = "cc-rebaseline-pixeltests"; |
| 141 | 112 |
| 142 // Disable textures using RGBA_4444 layout. | 113 // Disable textures using RGBA_4444 layout. |
| 143 const char kDisable4444Textures[] = "disable-4444-textures"; | 114 const char kDisable4444Textures[] = "disable-4444-textures"; |
| 144 | 115 |
| 145 // Disable touch hit testing in the compositor. | 116 // Disable touch hit testing in the compositor. |
| 146 const char kDisableCompositorTouchHitTesting[] = | 117 const char kDisableCompositorTouchHitTesting[] = |
| 147 "disable-compositor-touch-hit-testing"; | 118 "disable-compositor-touch-hit-testing"; |
| 148 | 119 |
| 149 bool IsLCDTextEnabled() { | |
| 150 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 151 if (command_line->HasSwitch(switches::kDisableLCDText)) | |
| 152 return false; | |
| 153 else if (command_line->HasSwitch(switches::kEnableLCDText)) | |
| 154 return true; | |
| 155 | |
| 156 #if defined(OS_ANDROID) | |
| 157 return false; | |
| 158 #else | |
| 159 return true; | |
| 160 #endif | |
| 161 } | |
| 162 | |
| 163 bool IsGpuRasterizationEnabled() { | |
| 164 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 165 | |
| 166 if (command_line.HasSwitch(switches::kDisableGPURasterization)) | |
| 167 return false; | |
| 168 else if (command_line.HasSwitch(switches::kEnableGPURasterization)) | |
| 169 return true; | |
| 170 | |
| 171 return false; | |
| 172 } | |
| 173 | |
| 174 bool IsImplSidePaintingEnabled() { | |
| 175 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 176 | |
| 177 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) | |
| 178 return false; | |
| 179 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) | |
| 180 return true; | |
| 181 | |
| 182 #if defined(OS_ANDROID) | |
| 183 return true; | |
| 184 #else | |
| 185 return false; | |
| 186 #endif | |
| 187 } | |
| 188 | |
| 189 bool IsMapImageEnabled() { | |
| 190 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 191 | |
| 192 if (command_line.HasSwitch(switches::kDisableMapImage)) | |
| 193 return false; | |
| 194 else if (command_line.HasSwitch(switches::kEnableMapImage)) | |
| 195 return true; | |
| 196 | |
| 197 return false; | |
| 198 } | |
| 199 | |
| 200 } // namespace switches | 120 } // namespace switches |
| 201 } // namespace cc | 121 } // namespace cc |
| OLD | NEW |