| Index: cc/trees/single_thread_proxy.cc
|
| diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
|
| index 130504639d2c9c65a41bac815c70d457fcbfbde3..1af657a3d0ead51ef2076e2a3133121699e800f1 100644
|
| --- a/cc/trees/single_thread_proxy.cc
|
| +++ b/cc/trees/single_thread_proxy.cc
|
| @@ -101,6 +101,7 @@
|
| if (scheduler_on_impl_thread_)
|
| scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
|
| // Changing visibility could change ShouldComposite().
|
| + UpdateBackgroundAnimateTicking();
|
| }
|
|
|
| void SingleThreadProxy::RequestNewOutputSurface() {
|
| @@ -160,24 +161,6 @@
|
| SetNeedsCommit();
|
| }
|
|
|
| -void SingleThreadProxy::DoAnimate() {
|
| - // Don't animate if there is no root layer.
|
| - // TODO(mithro): Both Animate and UpdateAnimationState already have a
|
| - // "!active_tree_->root_layer()" check?
|
| - if (!layer_tree_host_impl_->active_tree()->root_layer()) {
|
| - return;
|
| - }
|
| -
|
| - layer_tree_host_impl_->Animate(
|
| - layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time);
|
| -
|
| - // If animations are not visible, update the animation state now as it
|
| - // won't happen in DoComposite.
|
| - if (!layer_tree_host_impl_->AnimationsAreVisible()) {
|
| - layer_tree_host_impl_->UpdateAnimationState(true);
|
| - }
|
| -}
|
| -
|
| void SingleThreadProxy::DoCommit() {
|
| TRACE_EVENT0("cc", "SingleThreadProxy::DoCommit");
|
| DCHECK(Proxy::IsMainThread());
|
| @@ -218,6 +201,8 @@
|
| layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get());
|
|
|
| layer_tree_host_impl_->CommitComplete();
|
| +
|
| + UpdateBackgroundAnimateTicking();
|
|
|
| #if DCHECK_IS_ON
|
| // In the single-threaded case, the scale and scroll deltas should never be
|
| @@ -343,6 +328,7 @@
|
| TRACE_EVENT1(
|
| "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
|
| DCHECK(Proxy::IsImplThread());
|
| + UpdateBackgroundAnimateTicking();
|
| if (scheduler_on_impl_thread_)
|
| scheduler_on_impl_thread_->SetCanDraw(can_draw);
|
| }
|
| @@ -361,9 +347,7 @@
|
| }
|
|
|
| void SingleThreadProxy::SetNeedsAnimateOnImplThread() {
|
| - client_->ScheduleComposite();
|
| - if (scheduler_on_impl_thread_)
|
| - scheduler_on_impl_thread_->SetNeedsAnimate();
|
| + SetNeedsRedrawOnImplThread();
|
| }
|
|
|
| void SingleThreadProxy::SetNeedsManageTilesOnImplThread() {
|
| @@ -436,6 +420,7 @@
|
| weak_factory_.GetWeakPtr()));
|
| }
|
|
|
| + UpdateBackgroundAnimateTicking();
|
| timing_history_.DidActivateSyncTree();
|
| }
|
|
|
| @@ -513,8 +498,6 @@
|
| layer_tree_host_impl_->SynchronouslyInitializeAllTiles();
|
| }
|
|
|
| - DoAnimate();
|
| -
|
| LayerTreeHostImpl::FrameData frame;
|
| DoComposite(frame_begin_time, &frame);
|
|
|
| @@ -554,6 +537,12 @@
|
| DCHECK(Proxy::IsImplThread());
|
| return layer_tree_host_impl_->visible() &&
|
| layer_tree_host_impl_->CanDraw();
|
| +}
|
| +
|
| +void SingleThreadProxy::UpdateBackgroundAnimateTicking() {
|
| + DCHECK(Proxy::IsImplThread());
|
| + layer_tree_host_impl_->UpdateBackgroundAnimateTicking(
|
| + !ShouldComposite() && layer_tree_host_impl_->active_tree()->root_layer());
|
| }
|
|
|
| void SingleThreadProxy::ScheduleRequestNewOutputSurface() {
|
| @@ -583,10 +572,15 @@
|
| // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on
|
| // CanDraw() as well.
|
| if (!ShouldComposite()) {
|
| + UpdateBackgroundAnimateTicking();
|
| return DRAW_ABORTED_CANT_DRAW;
|
| }
|
|
|
| timing_history_.DidStartDrawing();
|
| +
|
| + layer_tree_host_impl_->Animate(
|
| + layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time);
|
| + UpdateBackgroundAnimateTicking();
|
|
|
| draw_result = layer_tree_host_impl_->PrepareToDraw(frame);
|
| draw_frame = draw_result == DRAW_SUCCESS;
|
| @@ -748,8 +742,8 @@
|
|
|
| void SingleThreadProxy::ScheduledActionAnimate() {
|
| TRACE_EVENT0("cc", "ScheduledActionAnimate");
|
| - DebugScopedSetImplThread impl(this);
|
| - DoAnimate();
|
| + layer_tree_host_impl_->Animate(
|
| + layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time);
|
| }
|
|
|
| void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() {
|
|
|