| 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/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/debug/devtools_instrumentation.h" | 10 #include "cc/debug/devtools_instrumentation.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 void SingleThreadProxy::SetLayerTreeHostClientReady() { | 91 void SingleThreadProxy::SetLayerTreeHostClientReady() { |
| 92 TRACE_EVENT0("cc", "SingleThreadProxy::SetLayerTreeHostClientReady"); | 92 TRACE_EVENT0("cc", "SingleThreadProxy::SetLayerTreeHostClientReady"); |
| 93 // Scheduling is controlled by the embedder in the single thread case, so | 93 // Scheduling is controlled by the embedder in the single thread case, so |
| 94 // nothing to do. | 94 // nothing to do. |
| 95 DCHECK(Proxy::IsMainThread()); | 95 DCHECK(Proxy::IsMainThread()); |
| 96 DebugScopedSetImplThread impl(this); | 96 DebugScopedSetImplThread impl(this); |
| 97 if (layer_tree_host_->settings().single_thread_proxy_scheduler && | 97 if (layer_tree_host_->settings().single_thread_proxy_scheduler && |
| 98 !scheduler_on_impl_thread_) { | 98 !scheduler_on_impl_thread_) { |
| 99 SchedulerSettings scheduler_settings(layer_tree_host_->settings()); | 99 SchedulerSettings scheduler_settings( |
| 100 layer_tree_host_->settings().ToSchedulerSettings()); |
| 100 // SingleThreadProxy should run in main thread low latency mode. | 101 // SingleThreadProxy should run in main thread low latency mode. |
| 101 scheduler_settings.main_thread_should_always_be_low_latency = true; | 102 scheduler_settings.main_thread_should_always_be_low_latency = true; |
| 102 scheduler_on_impl_thread_ = | 103 scheduler_on_impl_thread_ = |
| 103 Scheduler::Create(this, | 104 Scheduler::Create(this, |
| 104 scheduler_settings, | 105 scheduler_settings, |
| 105 layer_tree_host_->id(), | 106 layer_tree_host_->id(), |
| 106 MainThreadTaskRunner(), | 107 MainThreadTaskRunner(), |
| 107 external_begin_frame_source_.Pass()); | 108 external_begin_frame_source_.Pass()); |
| 108 scheduler_on_impl_thread_->SetCanStart(); | 109 scheduler_on_impl_thread_->SetCanStart(); |
| 109 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 110 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 | 824 |
| 824 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 825 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 825 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 826 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 826 } | 827 } |
| 827 | 828 |
| 828 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 829 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 829 layer_tree_host_->SendBeginFramesToChildren(args); | 830 layer_tree_host_->SendBeginFramesToChildren(args); |
| 830 } | 831 } |
| 831 | 832 |
| 832 } // namespace cc | 833 } // namespace cc |
| OLD | NEW |