| Index: cc/trees/thread_proxy.cc
|
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
|
| index 373eec01b97d5f740414cc7fd71c9f7e9b0739de..14e218194e026d57cf300dd7a41a58ac21cb5b8b 100644
|
| --- a/cc/trees/thread_proxy.cc
|
| +++ b/cc/trees/thread_proxy.cc
|
| @@ -176,7 +176,16 @@
|
| TRACE_EVENT0("cc", "ThreadProxy::SetVisibleOnImplThread");
|
| impl().layer_tree_host_impl->SetVisible(visible);
|
| impl().scheduler->SetVisible(visible);
|
| + UpdateBackgroundAnimateTicking();
|
| completion->Signal();
|
| +}
|
| +
|
| +void ThreadProxy::UpdateBackgroundAnimateTicking() {
|
| + bool should_background_tick =
|
| + !impl().scheduler->WillDrawIfNeeded() &&
|
| + impl().layer_tree_host_impl->active_tree()->root_layer();
|
| + impl().layer_tree_host_impl->UpdateBackgroundAnimateTicking(
|
| + should_background_tick);
|
| }
|
|
|
| void ThreadProxy::DidLoseOutputSurface() {
|
| @@ -349,6 +358,7 @@
|
| "cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
|
| DCHECK(IsImplThread());
|
| impl().scheduler->SetCanDraw(can_draw);
|
| + UpdateBackgroundAnimateTicking();
|
| }
|
|
|
| void ThreadProxy::NotifyReadyToActivate() {
|
| @@ -923,22 +933,9 @@
|
| TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate");
|
| DCHECK(IsImplThread());
|
|
|
| - // Don't animate if there is no root layer.
|
| - // TODO(mithro): Both Animate and UpdateAnimationState already have a
|
| - // "!active_tree_->root_layer()" check?
|
| - if (!impl().layer_tree_host_impl->active_tree()->root_layer()) {
|
| - return;
|
| - }
|
| -
|
| impl().animation_time =
|
| impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time;
|
| impl().layer_tree_host_impl->Animate(impl().animation_time);
|
| -
|
| - // If animations are not visible, update the state now as
|
| - // ScheduledActionDrawAndSwapIfPossible will never be called.
|
| - if (!impl().layer_tree_host_impl->AnimationsAreVisible()) {
|
| - impl().layer_tree_host_impl->UpdateAnimationState(true);
|
| - }
|
| }
|
|
|
| void ThreadProxy::ScheduledActionCommit() {
|
| @@ -981,6 +978,8 @@
|
| impl().layer_tree_host_impl->CommitComplete();
|
|
|
| SetInputThrottledUntilCommitOnImplThread(false);
|
| +
|
| + UpdateBackgroundAnimateTicking();
|
|
|
| impl().next_frame_is_newly_committed_frame = true;
|
|
|
| @@ -1359,6 +1358,8 @@
|
| impl().completion_event_for_commit_held_on_tree_activation = NULL;
|
| }
|
|
|
| + UpdateBackgroundAnimateTicking();
|
| +
|
| impl().timing_history.DidActivateSyncTree();
|
| }
|
|
|
|
|