Index: cc/base/switches.cc |
diff --git a/cc/base/switches.cc b/cc/base/switches.cc |
index 6c58f0ce90016cfb6afc3b4eead5eb6a9e7f91a4..14a4b71ae215ccb423b6f7304c4581db5c5d2481 100644 |
--- a/cc/base/switches.cc |
+++ b/cc/base/switches.cc |
@@ -37,6 +37,22 @@ const char kDisableDeadlineScheduling[] = "disable-deadline-scheduling"; |
// of less than 1 vsync if their intervals are properly nested. |
const char kEnableDeadlineScheduling[] = "enable-deadline-scheduling"; |
+// 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"; |
@@ -186,5 +202,41 @@ bool IsDeadlineSchedulingEnabled() { |
#endif |
} |
+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(cc::switches::kDisableStartCommitBeforeDraw)) |
+ return false; |
+ else if (command_line.HasSwitch(cc::switches::kEnableStartCommitBeforeDraw)) |
+ return true; |
+ |
+#if defined(OS_ANDROID) |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
+ |
+bool IsStartCommitBeforeActivateEnabled() { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ |
+ if (command_line.HasSwitch(cc::switches::kDisableStartCommitBeforeActivate)) |
+ return false; |
+ else if ( |
+ command_line.HasSwitch(cc::switches::kEnableStartCommitBeforeActivate)) |
+ return true; |
+ |
+#if defined(OS_ANDROID) |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
+ |
} // namespace switches |
} // namespace cc |