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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 << "DidFinishImplFrame called while not inside an impl frame!"; | 918 << "DidFinishImplFrame called while not inside an impl frame!"; |
913 inside_impl_frame_ = false; | 919 inside_impl_frame_ = false; |
914 #endif | 920 #endif |
915 } | 921 } |
916 | 922 |
917 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 923 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
918 layer_tree_host_->SendBeginFramesToChildren(args); | 924 layer_tree_host_->SendBeginFramesToChildren(args); |
919 } | 925 } |
920 | 926 |
921 } // namespace cc | 927 } // namespace cc |
OLD | NEW |