| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Scheduling is controlled by the embedder in the single thread case, so | 79 // Scheduling is controlled by the embedder in the single thread case, so |
| 80 // nothing to do. | 80 // nothing to do. |
| 81 DCHECK(Proxy::IsMainThread()); | 81 DCHECK(Proxy::IsMainThread()); |
| 82 DebugScopedSetImplThread impl(this); | 82 DebugScopedSetImplThread impl(this); |
| 83 if (layer_tree_host_->settings().single_thread_proxy_scheduler && | 83 if (layer_tree_host_->settings().single_thread_proxy_scheduler && |
| 84 !scheduler_on_impl_thread_) { | 84 !scheduler_on_impl_thread_) { |
| 85 SchedulerSettings scheduler_settings(layer_tree_host_->settings()); | 85 SchedulerSettings scheduler_settings(layer_tree_host_->settings()); |
| 86 scheduler_on_impl_thread_ = Scheduler::Create(this, | 86 scheduler_on_impl_thread_ = Scheduler::Create(this, |
| 87 scheduler_settings, | 87 scheduler_settings, |
| 88 layer_tree_host_->id(), | 88 layer_tree_host_->id(), |
| 89 MainThreadTaskRunner()); | 89 MainThreadTaskRunner(), |
| 90 base::PowerMonitor::Get()); |
| 90 scheduler_on_impl_thread_->SetCanStart(); | 91 scheduler_on_impl_thread_->SetCanStart(); |
| 91 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 92 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
| 92 } | 93 } |
| 93 } | 94 } |
| 94 | 95 |
| 95 void SingleThreadProxy::SetVisible(bool visible) { | 96 void SingleThreadProxy::SetVisible(bool visible) { |
| 96 TRACE_EVENT0("cc", "SingleThreadProxy::SetVisible"); | 97 TRACE_EVENT0("cc", "SingleThreadProxy::SetVisible"); |
| 97 DebugScopedSetImplThread impl(this); | 98 DebugScopedSetImplThread impl(this); |
| 98 layer_tree_host_impl_->SetVisible(visible); | 99 layer_tree_host_impl_->SetVisible(visible); |
| 99 if (scheduler_on_impl_thread_) | 100 if (scheduler_on_impl_thread_) |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 774 |
| 774 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 775 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 775 return timing_history_.CommitToActivateDurationEstimate(); | 776 return timing_history_.CommitToActivateDurationEstimate(); |
| 776 } | 777 } |
| 777 | 778 |
| 778 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 779 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 779 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 780 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 780 } | 781 } |
| 781 | 782 |
| 782 } // namespace cc | 783 } // namespace cc |
| OLD | NEW |