| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 DebugScopedSetImplThread impl(task_runner_provider_); | 357 DebugScopedSetImplThread impl(task_runner_provider_); |
| 358 | 358 |
| 359 BlockingTaskRunner::CapturePostTasks blocked( | 359 BlockingTaskRunner::CapturePostTasks blocked( |
| 360 task_runner_provider_->blocking_main_thread_task_runner()); | 360 task_runner_provider_->blocking_main_thread_task_runner()); |
| 361 scheduler_on_impl_thread_ = nullptr; | 361 scheduler_on_impl_thread_ = nullptr; |
| 362 layer_tree_host_impl_ = nullptr; | 362 layer_tree_host_impl_ = nullptr; |
| 363 } | 363 } |
| 364 layer_tree_host_ = NULL; | 364 layer_tree_host_ = NULL; |
| 365 } | 365 } |
| 366 | 366 |
| 367 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
| 368 DCHECK(task_runner_provider_->IsMainThread()); |
| 369 DebugScopedSetImplThread impl(task_runner_provider_); |
| 370 layer_tree_host_impl_->SetLayerTreeMutator(std::move(mutator)); |
| 371 } |
| 372 |
| 367 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 373 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
| 368 TRACE_EVENT1( | 374 TRACE_EVENT1( |
| 369 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 375 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
| 370 DCHECK(task_runner_provider_->IsImplThread()); | 376 DCHECK(task_runner_provider_->IsImplThread()); |
| 371 if (scheduler_on_impl_thread_) | 377 if (scheduler_on_impl_thread_) |
| 372 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 378 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
| 373 } | 379 } |
| 374 | 380 |
| 375 void SingleThreadProxy::NotifyReadyToActivate() { | 381 void SingleThreadProxy::NotifyReadyToActivate() { |
| 376 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); | 382 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 void SingleThreadProxy::DidFinishImplFrame() { | 901 void SingleThreadProxy::DidFinishImplFrame() { |
| 896 layer_tree_host_impl_->DidFinishImplFrame(); | 902 layer_tree_host_impl_->DidFinishImplFrame(); |
| 897 #if DCHECK_IS_ON() | 903 #if DCHECK_IS_ON() |
| 898 DCHECK(inside_impl_frame_) | 904 DCHECK(inside_impl_frame_) |
| 899 << "DidFinishImplFrame called while not inside an impl frame!"; | 905 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 900 inside_impl_frame_ = false; | 906 inside_impl_frame_ = false; |
| 901 #endif | 907 #endif |
| 902 } | 908 } |
| 903 | 909 |
| 904 } // namespace cc | 910 } // namespace cc |
| OLD | NEW |