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

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

Issue 23907006: cc: Allow sending BeginMainFrame before draw or activation (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedDeadline3
Patch Set: rebase 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 8
9 namespace cc { 9 namespace cc {
10 namespace switches { 10 namespace switches {
(...skipping 15 matching lines...) Expand all
26 // Paint content on the main thread instead of the compositor thread. 26 // Paint content on the main thread instead of the compositor thread.
27 // Overrides the kEnableImplSidePainting flag. 27 // Overrides the kEnableImplSidePainting flag.
28 const char kDisableImplSidePainting[] = "disable-impl-side-painting"; 28 const char kDisableImplSidePainting[] = "disable-impl-side-painting";
29 29
30 // Enables LCD text. 30 // Enables LCD text.
31 const char kEnableLCDText[] = "enable-lcd-text"; 31 const char kEnableLCDText[] = "enable-lcd-text";
32 32
33 // Paint content on the compositor thread instead of the main thread. 33 // Paint content on the compositor thread instead of the main thread.
34 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; 34 const char kEnableImplSidePainting[] = "enable-impl-side-painting";
35 35
36 // Disables the starting the next commit before the previous commit has drawn.
37 // Overrides the kEnableStartCommitBeforeDraw flag.
38 const char kDisableStartCommitBeforeDraw[] = "disable-start-commit-before-draw";
39
40 // Allows the next commit to start before the previous commit has drawn.
41 const char kEnableStartCommitBeforeDraw[] = "enable-start-commit-before-draw";
42
43 // Disables the starting the next commit before the previous commit activates.
44 // Overrides the kEnableStartCommitBeforeDraw flag.
45 const char kDisableStartCommitBeforeActivate[] =
46 "disable-start-commit-before-activate";
47
48 // Allows the next commit to start before the previous commit activates.
49 const char kEnableStartCommitBeforeActivate[] =
50 "enable-start-commit-before-activate";
51
36 const char kEnableTopControlsPositionCalculation[] = 52 const char kEnableTopControlsPositionCalculation[] =
37 "enable-top-controls-position-calculation"; 53 "enable-top-controls-position-calculation";
38 54
39 // Allow heuristics to determine when a layer tile should be drawn with 55 // Allow heuristics to determine when a layer tile should be drawn with
40 // the Skia GPU backend. Only valid with GPU accelerated compositing + 56 // the Skia GPU backend. Only valid with GPU accelerated compositing +
41 // impl-side painting. 57 // impl-side painting.
42 const char kEnableGPURasterization[] = "enable-gpu-rasterization"; 58 const char kEnableGPURasterization[] = "enable-gpu-rasterization";
43 59
44 // Disable GPU rasterization, i.e. rasterize on the CPU only. 60 // Disable GPU rasterization, i.e. rasterize on the CPU only.
45 // Overrides the kEnableGPURasterization flag. 61 // Overrides the kEnableGPURasterization flag.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 211 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
196 212
197 if (command_line.HasSwitch(switches::kDisableMapImage)) 213 if (command_line.HasSwitch(switches::kDisableMapImage))
198 return false; 214 return false;
199 else if (command_line.HasSwitch(switches::kEnableMapImage)) 215 else if (command_line.HasSwitch(switches::kEnableMapImage))
200 return true; 216 return true;
201 217
202 return false; 218 return false;
203 } 219 }
204 220
221 bool IsStartCommitBeforeDrawEnabled() {
222 // Starting the commit before activation implies starting the commit
223 // before draw as well.
224 if (IsStartCommitBeforeActivateEnabled())
225 return true;
226
227 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
228
229 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeDraw))
230 return false;
231 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeDraw))
232 return true;
233
234 return true;
235 }
236
237 bool IsStartCommitBeforeActivateEnabled() {
238 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
239
240 if (command_line.HasSwitch(switches::kDisableStartCommitBeforeActivate))
241 return false;
242 else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeActivate))
243 return true;
244
245 return false;
246 }
247
205 } // namespace switches 248 } // namespace switches
206 } // namespace cc 249 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698