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