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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 798323003: cc: Only send a BeginMainFrame inside an BeginImplFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing for rename. Created 6 years 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
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 323def6fb65a709a5f031576f4a7debc0d984bf7..ccf6b14e08e97b9dd8821ffc03a9be79635398aa 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -342,6 +342,10 @@ bool SchedulerStateMachine::ShouldDraw() const {
if (PendingDrawsShouldBeAborted())
return active_tree_needs_first_draw_;
+ // Don't draw if we are waiting on the first commit after a surface.
+ if (output_surface_state_ != OUTPUT_SURFACE_ACTIVE)
+ return false;
+
// If a commit has occurred after the animate call, we need to call animate
// again before we should draw.
if (did_commit_after_animating_)
@@ -387,6 +391,10 @@ bool SchedulerStateMachine::ShouldActivatePendingTree() const {
}
bool SchedulerStateMachine::ShouldAnimate() const {
+ // Don't animate if we are waiting on the first commit after a surface.
+ if (output_surface_state_ != OUTPUT_SURFACE_ACTIVE)
+ return false;
+
// If a commit occurred after our last call, we need to do animation again.
if (HasAnimatedThisFrame() && !did_commit_after_animating_)
return false;
@@ -424,10 +432,6 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
return false;
}
- // We want to start the first commit after we get a new output surface ASAP.
- if (output_surface_state_ == OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT)
- return true;
-
// We should not send BeginMainFrame while we are in
// BEGIN_IMPL_FRAME_STATE_IDLE since we might have new
// user input arriving soon.
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698