| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
| 10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void SingleThreadProxy::SetLayerTreeHostClientReady() { | 93 void SingleThreadProxy::SetLayerTreeHostClientReady() { |
| 94 // Scheduling is controlled by the embedder in the single thread case, so | 94 // Scheduling is controlled by the embedder in the single thread case, so |
| 95 // nothing to do. | 95 // nothing to do. |
| 96 } | 96 } |
| 97 | 97 |
| 98 void SingleThreadProxy::SetVisible(bool visible) { | 98 void SingleThreadProxy::SetVisible(bool visible) { |
| 99 DebugScopedSetImplThread impl(this); | 99 DebugScopedSetImplThread impl(this); |
| 100 layer_tree_host_impl_->SetVisible(visible); | 100 layer_tree_host_impl_->SetVisible(visible); |
| 101 |
| 102 // Changing visibility could change ShouldComposite(). |
| 103 layer_tree_host_impl_->UpdateBackgroundAnimateTicking(!ShouldComposite()); |
| 101 } | 104 } |
| 102 | 105 |
| 103 void SingleThreadProxy::CreateAndInitializeOutputSurface() { | 106 void SingleThreadProxy::CreateAndInitializeOutputSurface() { |
| 104 TRACE_EVENT0( | 107 TRACE_EVENT0( |
| 105 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface"); | 108 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface"); |
| 106 DCHECK(Proxy::IsMainThread()); | 109 DCHECK(Proxy::IsMainThread()); |
| 107 | 110 |
| 108 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); | 111 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); |
| 109 if (!output_surface) | 112 if (!output_surface) |
| 110 output_surface = layer_tree_host_->CreateOutputSurface(); | 113 output_surface = layer_tree_host_->CreateOutputSurface(); |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 void SingleThreadProxy::DidSwapFrame() { | 489 void SingleThreadProxy::DidSwapFrame() { |
| 487 if (next_frame_is_newly_committed_frame_) { | 490 if (next_frame_is_newly_committed_frame_) { |
| 488 next_frame_is_newly_committed_frame_ = false; | 491 next_frame_is_newly_committed_frame_ = false; |
| 489 layer_tree_host_->DidCommitAndDrawFrame(); | 492 layer_tree_host_->DidCommitAndDrawFrame(); |
| 490 } | 493 } |
| 491 } | 494 } |
| 492 | 495 |
| 493 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 496 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
| 494 | 497 |
| 495 } // namespace cc | 498 } // namespace cc |
| OLD | NEW |