| Index: cc/trees/thread_proxy.cc
|
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
|
| index 37830f601dd0ce1351ecddc55fb0bd6b59b7dd1c..65e8dd27a35de390d404d951d5b701fc56dc5224 100644
|
| --- a/cc/trees/thread_proxy.cc
|
| +++ b/cc/trees/thread_proxy.cc
|
| @@ -176,18 +176,9 @@ void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion,
|
| 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() {
|
| TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface");
|
| DCHECK(IsMainThread());
|
| @@ -358,7 +349,6 @@ void ThreadProxy::OnCanDrawStateChanged(bool can_draw) {
|
| "cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
|
| DCHECK(IsImplThread());
|
| impl().scheduler->SetCanDraw(can_draw);
|
| - UpdateBackgroundAnimateTicking();
|
| }
|
|
|
| void ThreadProxy::NotifyReadyToActivate() {
|
| @@ -927,9 +917,22 @@ void ThreadProxy::ScheduledActionAnimate() {
|
| 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() {
|
| @@ -973,8 +976,6 @@ void ThreadProxy::ScheduledActionCommit() {
|
|
|
| SetInputThrottledUntilCommitOnImplThread(false);
|
|
|
| - UpdateBackgroundAnimateTicking();
|
| -
|
| impl().next_frame_is_newly_committed_frame = true;
|
|
|
| impl().timing_history.DidCommit();
|
| @@ -1352,8 +1353,6 @@ void ThreadProxy::DidActivateSyncTree() {
|
| impl().completion_event_for_commit_held_on_tree_activation = NULL;
|
| }
|
|
|
| - UpdateBackgroundAnimateTicking();
|
| -
|
| impl().timing_history.DidActivateSyncTree();
|
| }
|
|
|
|
|