| Index: cc/scheduler/scheduler_state_machine.cc
|
| diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
|
| index a37a74a1b657fb953b39e46a157e41131be2e5dc..d32e44cbb88fe7958d60599009889847325b9c39 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;
|
|
|