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

Unified 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: Fix smoothness mode Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/base/switches.cc
diff --git a/cc/base/switches.cc b/cc/base/switches.cc
index 5f405ea082e334350f478c042d2b920c447000f9..7e7724a44b98a3bcdc1144548726e1f02e68af44 100644
--- a/cc/base/switches.cc
+++ b/cc/base/switches.cc
@@ -33,6 +33,22 @@ const char kEnableLCDText[] = "enable-lcd-text";
// Paint content on the compositor thread instead of the main thread.
const char kEnableImplSidePainting[] = "enable-impl-side-painting";
+// Disables the starting the next commit before the previous commit has drawn.
+// Overrides the kEnableStartCommitBeforeDraw flag.
+const char kDisableStartCommitBeforeDraw[] = "disable-start-commit-before-draw";
+
+// Allows the next commit to start before the previous commit has drawn.
+const char kEnableStartCommitBeforeDraw[] = "enable-start-commit-before-draw";
+
+// Disables the starting the next commit before the previous commit activates.
+// Overrides the kEnableStartCommitBeforeDraw flag.
+const char kDisableStartCommitBeforeActivate[] =
+ "disable-start-commit-before-activate";
+
+// Allows the next commit to start before the previous commit activates.
+const char kEnableStartCommitBeforeActivate[] =
+ "enable-start-commit-before-activate";
+
const char kEnableTopControlsPositionCalculation[] =
"enable-top-controls-position-calculation";
@@ -206,5 +222,32 @@ bool IsMapImageEnabled() {
return false;
}
+bool IsStartCommitBeforeDrawEnabled() {
+ // Starting the commit before activation implies starting the commit
+ // before draw as well.
+ if (IsStartCommitBeforeActivateEnabled())
+ return true;
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableStartCommitBeforeDraw))
+ return false;
+ else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeDraw))
+ return true;
+
+ return true;
+}
+
+bool IsStartCommitBeforeActivateEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableStartCommitBeforeActivate))
+ return false;
+ else if (command_line.HasSwitch(switches::kEnableStartCommitBeforeActivate))
+ return true;
+
+ return false;
+}
+
} // namespace switches
} // namespace cc
« no previous file with comments | « cc/base/switches.h ('k') | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698