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 DebugScopedSetImplThreadAndMainThreadBlocked impl(this); | 100 DebugScopedSetImplThread 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 DebugScopedSetImplThreadAndMainThreadBlocked impl_with_main_blocked(this); | 179 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
| 180 DebugScopedSetImplThread impl(this); |
| 181 |
180 RenderingStatsInstrumentation* stats_instrumentation = | 182 RenderingStatsInstrumentation* stats_instrumentation = |
181 layer_tree_host_->rendering_stats_instrumentation(); | 183 layer_tree_host_->rendering_stats_instrumentation(); |
182 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 184 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
183 | 185 |
184 layer_tree_host_impl_->BeginCommit(); | 186 layer_tree_host_impl_->BeginCommit(); |
185 | 187 |
186 layer_tree_host_->contents_texture_manager()-> | 188 layer_tree_host_->contents_texture_manager()-> |
187 PushTexturePrioritiesToBackings(); | 189 PushTexturePrioritiesToBackings(); |
188 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 190 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
189 | 191 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 478 |
477 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 479 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
478 | 480 |
479 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { | 481 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { |
480 // Impl-side painting only. | 482 // Impl-side painting only. |
481 NOTREACHED(); | 483 NOTREACHED(); |
482 return skia::RefPtr<SkPicture>(); | 484 return skia::RefPtr<SkPicture>(); |
483 } | 485 } |
484 | 486 |
485 } // namespace cc | 487 } // namespace cc |
OLD | NEW |