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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 DebugScopedSetImplThread impl(task_runner_provider_); | 362 DebugScopedSetImplThread impl(task_runner_provider_); |
363 | 363 |
364 BlockingTaskRunner::CapturePostTasks blocked( | 364 BlockingTaskRunner::CapturePostTasks blocked( |
365 task_runner_provider_->blocking_main_thread_task_runner()); | 365 task_runner_provider_->blocking_main_thread_task_runner()); |
366 scheduler_on_impl_thread_ = nullptr; | 366 scheduler_on_impl_thread_ = nullptr; |
367 layer_tree_host_impl_ = nullptr; | 367 layer_tree_host_impl_ = nullptr; |
368 } | 368 } |
369 layer_tree_host_ = NULL; | 369 layer_tree_host_ = NULL; |
370 } | 370 } |
371 | 371 |
| 372 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
| 373 DCHECK(task_runner_provider_->IsMainThread()); |
| 374 DebugScopedSetImplThread impl(task_runner_provider_); |
| 375 layer_tree_host_impl_->SetLayerTreeMutator(std::move(mutator)); |
| 376 } |
| 377 |
372 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 378 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
373 TRACE_EVENT1( | 379 TRACE_EVENT1( |
374 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 380 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
375 DCHECK(task_runner_provider_->IsImplThread()); | 381 DCHECK(task_runner_provider_->IsImplThread()); |
376 if (scheduler_on_impl_thread_) | 382 if (scheduler_on_impl_thread_) |
377 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 383 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
378 } | 384 } |
379 | 385 |
380 void SingleThreadProxy::NotifyReadyToActivate() { | 386 void SingleThreadProxy::NotifyReadyToActivate() { |
381 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); | 387 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 void SingleThreadProxy::DidFinishImplFrame() { | 889 void SingleThreadProxy::DidFinishImplFrame() { |
884 layer_tree_host_impl_->DidFinishImplFrame(); | 890 layer_tree_host_impl_->DidFinishImplFrame(); |
885 #if DCHECK_IS_ON() | 891 #if DCHECK_IS_ON() |
886 DCHECK(inside_impl_frame_) | 892 DCHECK(inside_impl_frame_) |
887 << "DidFinishImplFrame called while not inside an impl frame!"; | 893 << "DidFinishImplFrame called while not inside an impl frame!"; |
888 inside_impl_frame_ = false; | 894 inside_impl_frame_ = false; |
889 #endif | 895 #endif |
890 } | 896 } |
891 | 897 |
892 } // namespace cc | 898 } // namespace cc |
OLD | NEW |