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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 output_surface_before_initialization_ = output_surface.Pass(); | 99 output_surface_before_initialization_ = output_surface.Pass(); |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 void SingleThreadProxy::SetSurfaceReady() { | 103 void SingleThreadProxy::SetSurfaceReady() { |
104 // Scheduling is controlled by the embedder in the single thread case, so | 104 // Scheduling is controlled by the embedder in the single thread case, so |
105 // nothing to do. | 105 // nothing to do. |
106 } | 106 } |
107 | 107 |
108 void SingleThreadProxy::SetVisible(bool visible) { | 108 void SingleThreadProxy::SetVisible(bool visible) { |
109 DebugScopedSetImplThread impl(this); | 109 DebugScopedSetImplThreadAndMainThreadBlocked impl(this); |
110 layer_tree_host_impl_->SetVisible(visible); | 110 layer_tree_host_impl_->SetVisible(visible); |
111 } | 111 } |
112 | 112 |
113 bool SingleThreadProxy::InitializeRenderer() { | 113 bool SingleThreadProxy::InitializeRenderer() { |
114 DCHECK(Proxy::IsMainThread()); | 114 DCHECK(Proxy::IsMainThread()); |
115 DCHECK(output_surface_before_initialization_.get()); | 115 DCHECK(output_surface_before_initialization_.get()); |
116 { | 116 { |
117 DebugScopedSetImplThread impl(this); | 117 DebugScopedSetImplThread impl(this); |
118 bool ok = layer_tree_host_impl_->InitializeRenderer( | 118 bool ok = layer_tree_host_impl_->InitializeRenderer( |
119 output_surface_before_initialization_.Pass()); | 119 output_surface_before_initialization_.Pass()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 176 |
177 void SingleThreadProxy::SetNeedsAnimate() { | 177 void SingleThreadProxy::SetNeedsAnimate() { |
178 // Thread-only feature. | 178 // Thread-only feature. |
179 NOTREACHED(); | 179 NOTREACHED(); |
180 } | 180 } |
181 | 181 |
182 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { | 182 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { |
183 DCHECK(Proxy::IsMainThread()); | 183 DCHECK(Proxy::IsMainThread()); |
184 // Commit immediately. | 184 // Commit immediately. |
185 { | 185 { |
186 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 186 DebugScopedSetImplThreadAndMainThreadBlocked impl_and_main_blocked(this); |
danakj
2013/04/25 20:56:57
nit: s/and/with/ (theyre not both blocked)
| |
187 DebugScopedSetImplThread impl(this); | |
188 | |
189 RenderingStatsInstrumentation* stats_instrumentation = | 187 RenderingStatsInstrumentation* stats_instrumentation = |
190 layer_tree_host_->rendering_stats_instrumentation(); | 188 layer_tree_host_->rendering_stats_instrumentation(); |
191 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 189 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
192 | 190 |
193 layer_tree_host_impl_->BeginCommit(); | 191 layer_tree_host_impl_->BeginCommit(); |
194 | 192 |
195 layer_tree_host_->contents_texture_manager()-> | 193 layer_tree_host_->contents_texture_manager()-> |
196 PushTexturePrioritiesToBackings(); | 194 PushTexturePrioritiesToBackings(); |
197 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 195 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
198 | 196 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 | 467 |
470 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 468 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
471 | 469 |
472 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { | 470 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { |
473 // Impl-side painting only. | 471 // Impl-side painting only. |
474 NOTREACHED(); | 472 NOTREACHED(); |
475 return skia::RefPtr<SkPicture>(); | 473 return skia::RefPtr<SkPicture>(); |
476 } | 474 } |
477 | 475 |
478 } // namespace cc | 476 } // namespace cc |
OLD | NEW |