Chromium Code Reviews| Index: cc/trees/single_thread_proxy.cc |
| diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc |
| index cb42f0853b168561d3efe98c76ca8ba24596b1df..e418740e3d9cd260455f4726d08f4265dc49d8f0 100644 |
| --- a/cc/trees/single_thread_proxy.cc |
| +++ b/cc/trees/single_thread_proxy.cc |
| @@ -100,7 +100,7 @@ void SingleThreadProxy::SetVisible(bool visible) { |
| layer_tree_host_impl_->SetVisible(visible); |
| // Changing visibility could change ShouldComposite(). |
| - layer_tree_host_impl_->UpdateBackgroundAnimateTicking(!ShouldComposite()); |
| + UpdateBackgroundAnimateTicking(); |
| } |
| void SingleThreadProxy::CreateAndInitializeOutputSurface() { |
| @@ -265,7 +265,7 @@ void SingleThreadProxy::Stop() { |
| void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
| DCHECK(Proxy::IsImplThread()); |
| - layer_tree_host_impl_->UpdateBackgroundAnimateTicking(!ShouldComposite()); |
| + UpdateBackgroundAnimateTicking(); |
| } |
| void SingleThreadProxy::NotifyReadyToActivate() { |
| @@ -427,6 +427,13 @@ bool SingleThreadProxy::ShouldComposite() const { |
| 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()); |
| +} |
| + |
| bool SingleThreadProxy::DoComposite( |
| scoped_refptr<cc::ContextProvider> offscreen_context_provider, |
| base::TimeTicks frame_begin_time, |
| @@ -450,14 +457,14 @@ bool SingleThreadProxy::DoComposite( |
| // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
| // CanDraw() as well. |
| if (!ShouldComposite() || (for_readback && !can_do_readback)) { |
| - layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true); |
| + UpdateBackgroundAnimateTicking(); |
|
brianderson
2013/08/29 01:03:09
For the same reasons as in ThreadProxy, I do not a
|
| return false; |
| } |
| layer_tree_host_impl_->Animate( |
| layer_tree_host_impl_->CurrentFrameTimeTicks(), |
| layer_tree_host_impl_->CurrentFrameTime()); |
| - layer_tree_host_impl_->UpdateBackgroundAnimateTicking(false); |
| + UpdateBackgroundAnimateTicking(); |
| layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect); |
| layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); |