| 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/layer_tree_host_in_process.h" | 5 #include "cc/trees/layer_tree_host_in_process.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 rendering_stats_instrumentation_->set_record_rendering_stats( | 127 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 128 debug_state_.RecordRenderingStats()); | 128 debug_state_.RecordRenderingStats()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void LayerTreeHostInProcess::InitializeThreaded( | 131 void LayerTreeHostInProcess::InitializeThreaded( |
| 132 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 132 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 133 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 133 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
| 134 task_runner_provider_ = | 134 task_runner_provider_ = |
| 135 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 135 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
| 136 std::unique_ptr<ProxyMain> proxy_main = | 136 std::unique_ptr<ProxyMain> proxy_main = |
| 137 ProxyMain::CreateThreaded(this, task_runner_provider_.get()); | 137 base::MakeUnique<ProxyMain>(this, task_runner_provider_.get()); |
| 138 InitializeProxy(std::move(proxy_main)); | 138 InitializeProxy(std::move(proxy_main)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void LayerTreeHostInProcess::InitializeSingleThreaded( | 141 void LayerTreeHostInProcess::InitializeSingleThreaded( |
| 142 LayerTreeHostSingleThreadClient* single_thread_client, | 142 LayerTreeHostSingleThreadClient* single_thread_client, |
| 143 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { | 143 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { |
| 144 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); | 144 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); |
| 145 InitializeProxy(SingleThreadProxy::Create(this, single_thread_client, | 145 InitializeProxy(SingleThreadProxy::Create(this, single_thread_client, |
| 146 task_runner_provider_.get())); | 146 task_runner_provider_.get())); |
| 147 } | 147 } |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 return compositor_mode_ == CompositorMode::SINGLE_THREADED; | 821 return compositor_mode_ == CompositorMode::SINGLE_THREADED; |
| 822 } | 822 } |
| 823 | 823 |
| 824 bool LayerTreeHostInProcess::IsThreaded() const { | 824 bool LayerTreeHostInProcess::IsThreaded() const { |
| 825 DCHECK(compositor_mode_ != CompositorMode::THREADED || | 825 DCHECK(compositor_mode_ != CompositorMode::THREADED || |
| 826 task_runner_provider_->HasImplThread()); | 826 task_runner_provider_->HasImplThread()); |
| 827 return compositor_mode_ == CompositorMode::THREADED; | 827 return compositor_mode_ == CompositorMode::THREADED; |
| 828 } | 828 } |
| 829 | 829 |
| 830 } // namespace cc | 830 } // namespace cc |
| OLD | NEW |