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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 void SingleThreadProxy::Stop() { | 285 void SingleThreadProxy::Stop() { |
286 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); | 286 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); |
287 DCHECK(task_runner_provider_->IsMainThread()); | 287 DCHECK(task_runner_provider_->IsMainThread()); |
288 { | 288 { |
289 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 289 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
290 DebugScopedSetImplThread impl(task_runner_provider_); | 290 DebugScopedSetImplThread impl(task_runner_provider_); |
291 | 291 |
292 // Take away the CompositorFrameSink before destroying things so it doesn't | 292 // Take away the CompositorFrameSink before destroying things so it doesn't |
293 // try to call into its client mid-shutdown. | 293 // try to call into its client mid-shutdown. |
294 layer_tree_host_impl_->ReleaseCompositorFrameSink(); | 294 layer_tree_host_impl_->ReleaseCompositorFrameSink(); |
| 295 |
| 296 BlockingTaskRunner::CapturePostTasks blocked( |
| 297 task_runner_provider_->blocking_main_thread_task_runner()); |
295 scheduler_on_impl_thread_ = nullptr; | 298 scheduler_on_impl_thread_ = nullptr; |
296 layer_tree_host_impl_ = nullptr; | 299 layer_tree_host_impl_ = nullptr; |
297 } | 300 } |
298 layer_tree_host_ = nullptr; | 301 layer_tree_host_ = NULL; |
299 } | 302 } |
300 | 303 |
301 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { | 304 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
302 DCHECK(task_runner_provider_->IsMainThread()); | 305 DCHECK(task_runner_provider_->IsMainThread()); |
303 DebugScopedSetImplThread impl(task_runner_provider_); | 306 DebugScopedSetImplThread impl(task_runner_provider_); |
304 layer_tree_host_impl_->SetLayerTreeMutator(std::move(mutator)); | 307 layer_tree_host_impl_->SetLayerTreeMutator(std::move(mutator)); |
305 } | 308 } |
306 | 309 |
307 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 310 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
308 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", | 311 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 void SingleThreadProxy::DidFinishImplFrame() { | 741 void SingleThreadProxy::DidFinishImplFrame() { |
739 layer_tree_host_impl_->DidFinishImplFrame(); | 742 layer_tree_host_impl_->DidFinishImplFrame(); |
740 #if DCHECK_IS_ON() | 743 #if DCHECK_IS_ON() |
741 DCHECK(inside_impl_frame_) | 744 DCHECK(inside_impl_frame_) |
742 << "DidFinishImplFrame called while not inside an impl frame!"; | 745 << "DidFinishImplFrame called while not inside an impl frame!"; |
743 inside_impl_frame_ = false; | 746 inside_impl_frame_ = false; |
744 #endif | 747 #endif |
745 } | 748 } |
746 | 749 |
747 } // namespace cc | 750 } // namespace cc |
OLD | NEW |