Chromium Code Reviews| Index: cc/scheduler/scheduler_state_machine.cc |
| diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc |
| index 147a5a22830bce3a7d96a6956698881a39a15ec4..19477a3e29a89a97da079d77c2e72715fc1905bd 100644 |
| --- a/cc/scheduler/scheduler_state_machine.cc |
| +++ b/cc/scheduler/scheduler_state_machine.cc |
| @@ -715,7 +715,7 @@ void SchedulerStateMachine::SetSkipNextBeginMainFrameToReduceLatency() { |
| skip_next_begin_main_frame_to_reduce_latency_ = true; |
| } |
| -bool SchedulerStateMachine::BeginFrameNeededForChildren() const { |
| +bool SchedulerStateMachine::BeginFrameRequiredForChildren() const { |
| return children_need_begin_frames_; |
| } |
| @@ -724,7 +724,7 @@ bool SchedulerStateMachine::BeginFrameNeeded() const { |
| // TODO(brianderson): Support output surface creation inside a BeginFrame. |
| if (!HasInitializedOutputSurface()) |
| return false; |
| - return (BeginFrameNeededToAnimateOrDraw() || BeginFrameNeededForChildren() || |
| + return (BeginFrameRequiredForAction() || BeginFrameRequiredForChildren() || |
|
brianderson
2015/04/08 01:46:56
Should we put BeginFrameRequiredForChildren above
mithro-old
2015/04/09 04:08:07
I'll do that in a different CL.
|
| ProactiveBeginFrameWanted()); |
| } |
| @@ -737,9 +737,9 @@ void SchedulerStateMachine::SetDeferCommits(bool defer_commits) { |
| defer_commits_ = defer_commits; |
| } |
| -// These are the cases where we definitely (or almost definitely) have a |
| -// new frame to animate and/or draw and can draw. |
| -bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { |
| +// These are the cases where we require a BeginFrame message to make progress |
| +// on requested actions. |
| +bool SchedulerStateMachine::BeginFrameRequiredForAction() const { |
| // If we are not visible, we don't need BeginFrame messages. |
| if (!visible_) |
| return false; |
| @@ -749,13 +749,15 @@ bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { |
| if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) |
| return true; |
| - return needs_animate_ || needs_redraw_; |
| + return needs_animate_ || needs_redraw_ || (needs_commit_ && !defer_commits_); |
| } |
| -// These are cases where we are very likely to draw soon, but might not |
| -// actually have a new frame to draw when we receive the next BeginImplFrame. |
| -// Proactively requesting the BeginImplFrame helps hide the round trip latency |
| -// of the SetNeedsBeginFrame request that has to go to the Browser. |
| +// These are cases where we are very likely want a BeginFrame message in the |
| +// near future. Proactively requesting the BeginImplFrame helps hide the round |
| +// trip latency of the SetNeedsBeginFrame request that has to go to the |
| +// Browser. |
| +// This includes things like drawing soon, but might not actually have a new |
| +// frame to draw when we receive the next BeginImplFrame. |
| bool SchedulerStateMachine::ProactiveBeginFrameWanted() const { |
| // Do not be proactive when invisible. |
| if (!visible_) |
| @@ -766,7 +768,7 @@ bool SchedulerStateMachine::ProactiveBeginFrameWanted() const { |
| // request frames when commits are disabled, because the frame requests will |
| // not provide the needed commit (and will wake up the process when it could |
| // stay idle). |
| - if ((needs_commit_ || commit_state_ != COMMIT_STATE_IDLE) && !defer_commits_) |
| + if ((commit_state_ != COMMIT_STATE_IDLE) && !defer_commits_) |
| return true; |
| // If the pending tree activates quickly, we'll want a BeginImplFrame soon |