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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 return commit_requested_; | 351 return commit_requested_; |
352 } | 352 } |
353 | 353 |
354 void SingleThreadProxy::Stop() { | 354 void SingleThreadProxy::Stop() { |
355 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); | 355 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); |
356 DCHECK(task_runner_provider_->IsMainThread()); | 356 DCHECK(task_runner_provider_->IsMainThread()); |
357 { | 357 { |
358 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 358 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
359 DebugScopedSetImplThread impl(task_runner_provider_); | 359 DebugScopedSetImplThread impl(task_runner_provider_); |
360 | 360 |
| 361 // Take away the OutputSurface before destroying things so it doesn't try |
| 362 // to call into its client mid-shutdown. |
| 363 layer_tree_host_impl_->ReleaseOutputSurface(); |
| 364 |
361 BlockingTaskRunner::CapturePostTasks blocked( | 365 BlockingTaskRunner::CapturePostTasks blocked( |
362 task_runner_provider_->blocking_main_thread_task_runner()); | 366 task_runner_provider_->blocking_main_thread_task_runner()); |
363 scheduler_on_impl_thread_ = nullptr; | 367 scheduler_on_impl_thread_ = nullptr; |
364 layer_tree_host_impl_ = nullptr; | 368 layer_tree_host_impl_ = nullptr; |
365 } | 369 } |
366 layer_tree_host_ = NULL; | 370 layer_tree_host_ = NULL; |
367 } | 371 } |
368 | 372 |
369 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { | 373 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
370 DCHECK(task_runner_provider_->IsMainThread()); | 374 DCHECK(task_runner_provider_->IsMainThread()); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 void SingleThreadProxy::DidFinishImplFrame() { | 885 void SingleThreadProxy::DidFinishImplFrame() { |
882 layer_tree_host_impl_->DidFinishImplFrame(); | 886 layer_tree_host_impl_->DidFinishImplFrame(); |
883 #if DCHECK_IS_ON() | 887 #if DCHECK_IS_ON() |
884 DCHECK(inside_impl_frame_) | 888 DCHECK(inside_impl_frame_) |
885 << "DidFinishImplFrame called while not inside an impl frame!"; | 889 << "DidFinishImplFrame called while not inside an impl frame!"; |
886 inside_impl_frame_ = false; | 890 inside_impl_frame_ = false; |
887 #endif | 891 #endif |
888 } | 892 } |
889 | 893 |
890 } // namespace cc | 894 } // namespace cc |
OLD | NEW |