Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: cc/base/switches.cc

Issue 181063022: cc: Trigger GPU rasterization based on a per-layer hint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/base/switches.h ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
17 // Disables LCD text.
18 const char kDisableLCDText[] = "disable-lcd-text";
19
20 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; 19 const char kDisableThreadedAnimation[] = "disable-threaded-animation";
21 20
22 // Disables layer-edge anti-aliasing in the compositor. 21 // Disables layer-edge anti-aliasing in the compositor.
23 const char kDisableCompositedAntialiasing[] = 22 const char kDisableCompositedAntialiasing[] =
24 "disable-composited-antialiasing"; 23 "disable-composited-antialiasing";
25 24
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[] = 25 const char kEnableTopControlsPositionCalculation[] =
37 "enable-top-controls-position-calculation"; 26 "enable-top-controls-position-calculation";
38 27
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. 28 // The height of the movable top controls.
49 const char kTopControlsHeight[] = "top-controls-height"; 29 const char kTopControlsHeight[] = "top-controls-height";
50 30
51 // Percentage of the top controls need to be hidden before they will auto hide. 31 // Percentage of the top controls need to be hidden before they will auto hide.
52 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; 32 const char kTopControlsHideThreshold[] = "top-controls-hide-threshold";
53 33
54 // Percentage of the top controls need to be shown before they will auto show. 34 // Percentage of the top controls need to be shown before they will auto show.
55 const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; 35 const char kTopControlsShowThreshold[] = "top-controls-show-threshold";
56 36
57 // Show metrics about overdraw in about:tracing recordings, such as the number 37 // Show metrics about overdraw in about:tracing recordings, such as the number
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Show rects in the HUD wherever something is known to be drawn opaque and is 104 // Show rects in the HUD wherever something is known to be drawn opaque and is
125 // considered occluding the pixels behind it. 105 // considered occluding the pixels behind it.
126 const char kShowOccludingRects[] = "show-occluding-rects"; 106 const char kShowOccludingRects[] = "show-occluding-rects";
127 const char kUIShowOccludingRects[] = "ui-show-occluding-rects"; 107 const char kUIShowOccludingRects[] = "ui-show-occluding-rects";
128 108
129 // Show rects in the HUD wherever something is not known to be drawn opaque and 109 // 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. 110 // is not considered to be occluding the pixels behind it.
131 const char kShowNonOccludingRects[] = "show-nonoccluding-rects"; 111 const char kShowNonOccludingRects[] = "show-nonoccluding-rects";
132 const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects"; 112 const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects";
133 113
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. 114 // Prevents the layer tree unit tests from timing out.
142 const char kCCLayerTreeTestNoTimeout[] = "cc-layer-tree-test-no-timeout"; 115 const char kCCLayerTreeTestNoTimeout[] = "cc-layer-tree-test-no-timeout";
143 116
144 // Makes pixel tests write their output instead of read it. 117 // Makes pixel tests write their output instead of read it.
145 const char kCCRebaselinePixeltests[] = "cc-rebaseline-pixeltests"; 118 const char kCCRebaselinePixeltests[] = "cc-rebaseline-pixeltests";
146 119
147 // Disable textures using RGBA_4444 layout. 120 // Disable textures using RGBA_4444 layout.
148 const char kDisable4444Textures[] = "disable-4444-textures"; 121 const char kDisable4444Textures[] = "disable-4444-textures";
149 122
150 // Disable touch hit testing in the compositor. 123 // Disable touch hit testing in the compositor.
151 const char kDisableCompositorTouchHitTesting[] = 124 const char kDisableCompositorTouchHitTesting[] =
152 "disable-compositor-touch-hit-testing"; 125 "disable-compositor-touch-hit-testing";
153 126
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 127 } // namespace switches
206 } // namespace cc 128 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/switches.h ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698