blob: 7e45074030db420352e32bc3aeea30964b39b51c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/base/switches.h"
#include "base/command_line.h"
namespace cc {
namespace switches {
// On platforms where checkerboards are used, prefer background colors instead
// of checkerboards.
const char kBackgroundColorInsteadOfCheckerboard[] =
"background-color-instead-of-checkerboard";
// Disables LCD text.
const char kDisableLCDText[] = "disable-lcd-text";
const char kDisableThreadedAnimation[] = "disable-threaded-animation";
// Disables layer-edge anti-aliasing in the compositor.
const char kDisableCompositedAntialiasing[] =
"disable-composited-antialiasing";
// Paint content on the main thread instead of the compositor thread.
// Overrides the kEnableImplSidePainting flag.
const char kDisableImplSidePainting[] = "disable-impl-side-painting";
// Enables LCD text.
const char kEnableLCDText[] = "enable-lcd-text";
// Paint content on the compositor thread instead of the main thread.
const char kEnableImplSidePainting[] = "enable-impl-side-painting";
const char kEnableTopControlsPositionCalculation[] =
"enable-top-controls-position-calculation";
// Allow heuristics to determine when a layer tile should be drawn with
// the Skia GPU backend. Only valid with GPU accelerated compositing +
// impl-side painting.
const char kEnableGPURasterization[] = "enable-gpu-rasterization";
// Disable GPU rasterization, i.e. rasterize on the CPU only.
// Overrides the kEnableGPURasterization flag.
const char kDisableGPURasterization[] = "disable-gpu-rasterization";
// The height of the movable top controls.
const char kTopControlsHeight[] = "top-controls-height";
// Percentage of the top controls need to be hidden before they will auto hide.
const char kTopControlsHideThreshold[] = "top-controls-hide-threshold";
// Percentage of the top controls need to be shown before they will auto show.
const char kTopControlsShowThreshold[] = "top-controls-show-threshold";
// Show metrics about overdraw in about:tracing recordings, such as the number
// of pixels culled, and the number of pixels drawn, for each frame.
const char kTraceOverdraw[] = "trace-overdraw";
// Re-rasters everything multiple times to simulate a much slower machine.
// Give a scale factor to cause raster to take that many times longer to
// complete, such as --slow-down-raster-scale-factor=25.
const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor";
// Max tiles allowed for each tilings interest area.
const char kMaxTilesForInterestArea[] = "max-tiles-for-interest-area";
// The amount of unused resource memory compositor is allowed to keep around.
const char kMaxUnusedResourceMemoryUsagePercentage[] =
"max-unused-resource-memory-usage-percentage";
// Causes the compositor to render to textures which are then sent to the parent
// through the texture mailbox mechanism.
// Requires --enable-compositor-frame-message.
const char kCompositeToMailbox[] = "composite-to-mailbox";
// Check that property changes during paint do not occur.
const char kStrictLayerPropertyChangeChecking[] =
"strict-layer-property-change-checking";
// Virtual viewport for fixed-position elements, scrollbars during pinch.
const char kEnablePinchVirtualViewport[] = "enable-pinch-virtual-viewport";
const char kEnablePartialSwap[] = "enable-partial-swap";
// Disable partial swap which is needed for some OpenGL drivers / emulators.
const char kUIDisablePartialSwap[] = "ui-disable-partial-swap";
const char kEnablePerTilePainting[] = "enable-per-tile-painting";
const char kUIEnablePerTilePainting[] = "ui-enable-per-tile-painting";
// Enables the GPU benchmarking extension
const char kEnableGpuBenchmarking[] = "enable-gpu-benchmarking";
// Renders a border around compositor layers to help debug and study
// layer compositing.
const char kShowCompositedLayerBorders[] = "show-composited-layer-borders";
const char kUIShowCompositedLayerBorders[] = "ui-show-layer-borders";
// Draws a FPS indicator
const char kShowFPSCounter[] = "show-fps-counter";
const char kUIShowFPSCounter[] = "ui-show-fps-counter";
// Renders a border that represents the bounding box for the layer's animation.
const char kShowLayerAnimationBounds[] = "show-layer-animation-bounds";
const char kUIShowLayerAnimationBounds[] = "ui-show-layer-animation-bounds";
// Show rects in the HUD around layers whose properties have changed.
const char kShowPropertyChangedRects[] = "show-property-changed-rects";
const char kUIShowPropertyChangedRects[] = "ui-show-property-changed-rects";
// Show rects in the HUD around damage as it is recorded into each render
// surface.
const char kShowSurfaceDamageRects[] = "show-surface-damage-rects";
const char kUIShowSurfaceDamageRects[] = "ui-show-surface-damage-rects";
// Show rects in the HUD around the screen-space transformed bounds of every
// layer.
const char kShowScreenSpaceRects[] = "show-screenspace-rects";
const char kUIShowScreenSpaceRects[] = "ui-show-screenspace-rects";
// Show rects in the HUD around the screen-space transformed bounds of every
// layer's replica, when they have one.
const char kShowReplicaScreenSpaceRects[] = "show-replica-screenspace-rects";
const char kUIShowReplicaScreenSpaceRects[] =
"ui-show-replica-screenspace-rects";
// Show rects in the HUD wherever something is known to be drawn opaque and is
// considered occluding the pixels behind it.
const char kShowOccludingRects[] = "show-occluding-rects";
const char kUIShowOccludingRects[] = "ui-show-occluding-rects";
// Show rects in the HUD wherever something is not known to be drawn opaque and
// is not considered to be occluding the pixels behind it.
const char kShowNonOccludingRects[] = "show-nonoccluding-rects";
const char kUIShowNonOccludingRects[] = "ui-show-nonoccluding-rects";
// Enable rasterizer that writes directly to GPU memory.
const char kEnableMapImage[] = "enable-map-image";
// Disable rasterizer that writes directly to GPU memory.
// Overrides the kEnableMapImage flag.
const char kDisableMapImage[] = "disable-map-image";
// Prevents the layer tree unit tests from timing out.
const char kCCLayerTreeTestNoTimeout[] = "cc-layer-tree-test-no-timeout";
// Makes pixel tests write their output instead of read it.
const char kCCRebaselinePixeltests[] = "cc-rebaseline-pixeltests";
// Disable textures using RGBA_4444 layout.
const char kDisable4444Textures[] = "disable-4444-textures";
// Disable touch hit testing in the compositor.
const char kDisableCompositorTouchHitTesting[] =
"disable-compositor-touch-hit-testing";
bool IsLCDTextEnabled() {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableLCDText))
return false;
else if (command_line->HasSwitch(switches::kEnableLCDText))
return true;
#if defined(OS_ANDROID)
return false;
#else
return true;
#endif
}
bool IsGpuRasterizationEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDisableGPURasterization))
return false;
else if (command_line.HasSwitch(switches::kEnableGPURasterization))
return true;
return false;
}
bool IsImplSidePaintingEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDisableImplSidePainting))
return false;
else if (command_line.HasSwitch(switches::kEnableImplSidePainting))
return true;
#if defined(OS_ANDROID)
return true;
#else
return false;
#endif
}
bool IsMapImageEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDisableMapImage))
return false;
else if (command_line.HasSwitch(switches::kEnableMapImage))
return true;
return false;
}
} // namespace switches
} // namespace cc
|