Index: cc/scheduler/scheduler_state_machine.cc |
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc |
index 1f47e6145517b1c7449469d275036a05f056f67a..cc6cf17598b819161031dd53a15aa20a7095128a 100644 |
--- a/cc/scheduler/scheduler_state_machine.cc |
+++ b/cc/scheduler/scheduler_state_machine.cc |
@@ -365,6 +365,9 @@ bool SchedulerStateMachine::ShouldDraw() const { |
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) |
return false; |
+ if (wait_for_ready_to_draw_) |
+ return false; |
+ |
// Only handle forced redraws due to timeouts on the regular deadline. |
if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) |
return true; |
@@ -482,6 +485,10 @@ bool SchedulerStateMachine::ShouldCommit() const { |
return false; |
} |
+ // Active tree resources might still be in use until the Display draws. |
+ if (settings_.commit_to_active_tree && SwapThrottled()) |
+ return false; |
+ |
// If we only have an active tree, it is incorrect to replace it |
// before we've drawn it. |
DCHECK(!settings_.commit_to_active_tree || !active_tree_needs_first_draw_); |
@@ -1025,11 +1032,6 @@ void SchedulerStateMachine::NotifyReadyToCommit() { |
DCHECK_EQ(begin_main_frame_state_, BEGIN_MAIN_FRAME_STATE_STARTED) |
<< AsValue()->ToString(); |
begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_READY_TO_COMMIT; |
- // In commit_to_active_tree mode, commit should happen right after |
- // BeginFrame, meaning when this function is called, next action should be |
- // commit. |
- if (settings_.commit_to_active_tree) |
- DCHECK(ShouldCommit()); |
} |
void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) { |