| Index: cc/scheduler/scheduler_state_machine.cc
|
| diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
|
| index 4f6d43f0d8bb7646ef8b77b16624817364a5a140..a6904ae2c6781341ced4067120f2089a43d740f1 100644
|
| --- a/cc/scheduler/scheduler_state_machine.cc
|
| +++ b/cc/scheduler/scheduler_state_machine.cc
|
| @@ -320,7 +320,7 @@ bool SchedulerStateMachine::ShouldBeginOutputSurfaceCreation() const {
|
| if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_IDLE)
|
| return false;
|
|
|
| - // We want to clear the pipeline of any pending draws and activations
|
| + // We want to clear the pipline of any pending draws and activations
|
| // before starting output surface initialization. This allows us to avoid
|
| // weird corner cases where we abort draws or force activation while we
|
| // are initializing the output surface.
|
| @@ -335,7 +335,7 @@ bool SchedulerStateMachine::ShouldBeginOutputSurfaceCreation() const {
|
| bool SchedulerStateMachine::ShouldDraw() const {
|
| // If we need to abort draws, we should do so ASAP since the draw could
|
| // be blocking other important actions (like output surface initialization),
|
| - // from occurring. If we are waiting for the first draw, then perform the
|
| + // from occuring. If we are waiting for the first draw, then perfom the
|
| // aborted draw to keep things moving. If we are not waiting for the first
|
| // draw however, we don't want to abort for no reason.
|
| if (PendingDrawsShouldBeAborted())
|
| @@ -474,6 +474,14 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
|
| if (!HasInitializedOutputSurface())
|
| return false;
|
|
|
| + // SwapAck throttle the BeginMainFrames unless we just swapped.
|
| + // TODO(brianderson): Remove this restriction to improve throughput.
|
| + bool just_swapped_in_deadline =
|
| + begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE &&
|
| + HasSwappedThisFrame();
|
| + if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline)
|
| + return false;
|
| +
|
| if (skip_begin_main_frame_to_reduce_latency_)
|
| return false;
|
|
|
|
|