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

Side by Side Diff: cc/switches.cc

Issue 12221005: Add flag to disable impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 7 years, 10 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
« no previous file with comments | « cc/switches.h ('k') | chrome/app/generated_resources.grd » ('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/switches.h" 5 #include "cc/switches.h"
6 6
7 #include "base/command_line.h"
8
7 namespace cc { 9 namespace cc {
8 namespace switches { 10 namespace switches {
9 11
10 // On platforms where checkerboards are used, prefer background colors instead 12 // On platforms where checkerboards are used, prefer background colors instead
11 // of checkerboards. 13 // of checkerboards.
12 const char kBackgroundColorInsteadOfCheckerboard[] = 14 const char kBackgroundColorInsteadOfCheckerboard[] =
13 "background-color-instead-of-checkerboard"; 15 "background-color-instead-of-checkerboard";
14 16
15 const char kDisableThreadedAnimation[] = "disable-threaded-animation"; 17 const char kDisableThreadedAnimation[] = "disable-threaded-animation";
16 18
17 // Send a message for every frame from the impl thread to the parent compositor. 19 // Send a message for every frame from the impl thread to the parent compositor.
18 const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message"; 20 const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message";
19 21
22 // Paint content on the main thread instead of the compositor thread.
23 // Overrides the kEnableImplSidePainting flag.
24 const char kDisableImplSidePainting[] = "disable-impl-side-painting";
25
20 // Paint content on the compositor thread instead of the main thread. 26 // Paint content on the compositor thread instead of the main thread.
21 const char kEnableImplSidePainting[] = "enable-impl-side-painting"; 27 const char kEnableImplSidePainting[] = "enable-impl-side-painting";
22 28
23 const char kEnablePartialSwap[] = "enable-partial-swap"; 29 const char kEnablePartialSwap[] = "enable-partial-swap";
24 30
25 const char kEnablePerTilePainting[] = "enable-per-tile-painting"; 31 const char kEnablePerTilePainting[] = "enable-per-tile-painting";
26 32
27 // Try to finish display pipeline before vsync tick 33 // Try to finish display pipeline before vsync tick
28 const char kEnableRightAlignedScheduling[] = "enable-right-aligned-scheduling"; 34 const char kEnableRightAlignedScheduling[] = "enable-right-aligned-scheduling";
29 35
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // complete, such as --slow-down-raster-scale-factor=25. 77 // complete, such as --slow-down-raster-scale-factor=25.
72 const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor"; 78 const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor";
73 79
74 // Schedule rasterization jobs according to their estimated processing cost. 80 // Schedule rasterization jobs according to their estimated processing cost.
75 const char kUseCheapnessEstimator[] = "use-cheapness-estimator"; 81 const char kUseCheapnessEstimator[] = "use-cheapness-estimator";
76 82
77 // The scale factor for low resolution tile contents. 83 // The scale factor for low resolution tile contents.
78 const char kLowResolutionContentsScaleFactor[] = 84 const char kLowResolutionContentsScaleFactor[] =
79 "low-resolution-contents-scale-factor"; 85 "low-resolution-contents-scale-factor";
80 86
87 bool IsImplSidePaintingEnabled() {
88 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
89
90 if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting))
91 return false;
92 else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting))
93 return true;
94
95 #if defined(OS_ANDROID)
96 return true;
97 #else
98 return false;
99 #endif
100 }
101
81 } // namespace switches 102 } // namespace switches
82 } // namespace cc 103 } // namespace cc
OLDNEW
« no previous file with comments | « cc/switches.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698