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/base/thread.h" | 9 #include "cc/base/thread.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 DCHECK(Proxy::IsMainThread()); | 90 DCHECK(Proxy::IsMainThread()); |
91 return layer_tree_host_impl_; | 91 return layer_tree_host_impl_; |
92 } | 92 } |
93 | 93 |
94 void SingleThreadProxy::SetLayerTreeHostClientReady() { | 94 void SingleThreadProxy::SetLayerTreeHostClientReady() { |
95 // Scheduling is controlled by the embedder in the single thread case, so | 95 // Scheduling is controlled by the embedder in the single thread case, so |
96 // nothing to do. | 96 // nothing to do. |
97 } | 97 } |
98 | 98 |
99 void SingleThreadProxy::SetVisible(bool visible) { | 99 void SingleThreadProxy::SetVisible(bool visible) { |
100 DebugScopedSetImplThread impl(this); | 100 DebugScopedSetImplThreadAndMainThreadBlocked impl(this); |
101 layer_tree_host_impl_->SetVisible(visible); | 101 layer_tree_host_impl_->SetVisible(visible); |
102 } | 102 } |
103 | 103 |
104 void SingleThreadProxy::CreateAndInitializeOutputSurface() { | 104 void SingleThreadProxy::CreateAndInitializeOutputSurface() { |
105 TRACE_EVENT0( | 105 TRACE_EVENT0( |
106 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface"); | 106 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface"); |
107 DCHECK(Proxy::IsMainThread()); | 107 DCHECK(Proxy::IsMainThread()); |
108 | 108 |
109 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); | 109 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); |
110 if (!output_surface) | 110 if (!output_surface) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 void SingleThreadProxy::SetNeedsAnimate() { | 170 void SingleThreadProxy::SetNeedsAnimate() { |
171 // Thread-only feature. | 171 // Thread-only feature. |
172 NOTREACHED(); | 172 NOTREACHED(); |
173 } | 173 } |
174 | 174 |
175 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { | 175 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { |
176 DCHECK(Proxy::IsMainThread()); | 176 DCHECK(Proxy::IsMainThread()); |
177 // Commit immediately. | 177 // Commit immediately. |
178 { | 178 { |
179 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 179 DebugScopedSetImplThreadAndMainThreadBlocked impl_with_main_blocked(this); |
180 DebugScopedSetImplThread impl(this); | |
181 | |
182 RenderingStatsInstrumentation* stats_instrumentation = | 180 RenderingStatsInstrumentation* stats_instrumentation = |
183 layer_tree_host_->rendering_stats_instrumentation(); | 181 layer_tree_host_->rendering_stats_instrumentation(); |
184 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 182 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
185 | 183 |
186 layer_tree_host_impl_->BeginCommit(); | 184 layer_tree_host_impl_->BeginCommit(); |
187 | 185 |
188 layer_tree_host_->contents_texture_manager()-> | 186 layer_tree_host_->contents_texture_manager()-> |
189 PushTexturePrioritiesToBackings(); | 187 PushTexturePrioritiesToBackings(); |
190 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 188 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
191 | 189 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 476 |
479 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 477 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
480 | 478 |
481 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { | 479 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { |
482 // Impl-side painting only. | 480 // Impl-side painting only. |
483 NOTREACHED(); | 481 NOTREACHED(); |
484 return skia::RefPtr<SkPicture>(); | 482 return skia::RefPtr<SkPicture>(); |
485 } | 483 } |
486 | 484 |
487 } // namespace cc | 485 } // namespace cc |
OLD | NEW |