Index: cc/scheduler/scheduler_state_machine.cc |
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc |
index 723c40c80c276d42ce3d1e2df2c58f51dfad5742..c66b650d96afa624fb2ab8a93dda14a7e366f3be 100644 |
--- a/cc/scheduler/scheduler_state_machine.cc |
+++ b/cc/scheduler/scheduler_state_machine.cc |
@@ -418,10 +418,21 @@ bool SchedulerStateMachine::ShouldAnimate() const { |
return needs_redraw_ || needs_animate_; |
} |
-bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { |
+bool SchedulerStateMachine::CouldSendBeginMainFrame() const { |
if (!needs_commit_) |
return false; |
+ // We can not perform commits if we are not visible. |
+ if (!visible_) |
+ return false; |
+ |
+ return true; |
+} |
+ |
+bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { |
+ if (!CouldSendBeginMainFrame()) |
+ return false; |
+ |
// Only send BeginMainFrame when there isn't another commit pending already. |
if (commit_state_ != COMMIT_STATE_IDLE) |
return false; |
@@ -433,10 +444,6 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { |
return false; |
} |
- // We do not need commits if we are not visible. |
- if (!visible_) |
- 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; |