| 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 new LayerTreeHost(client, manager, settings)); | 77 new LayerTreeHost(client, manager, settings)); |
| 78 layer_tree_host->InitializeThreaded(main_task_runner, impl_task_runner); | 78 layer_tree_host->InitializeThreaded(main_task_runner, impl_task_runner); |
| 79 return layer_tree_host.Pass(); | 79 return layer_tree_host.Pass(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded( | 82 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded( |
| 83 LayerTreeHostClient* client, | 83 LayerTreeHostClient* client, |
| 84 LayerTreeHostSingleThreadClient* single_thread_client, | 84 LayerTreeHostSingleThreadClient* single_thread_client, |
| 85 SharedBitmapManager* manager, | 85 SharedBitmapManager* manager, |
| 86 const LayerTreeSettings& settings, | 86 const LayerTreeSettings& settings, |
| 87 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { | 87 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 88 BeginFrameManager* begin_frame_manager) { |
| 88 scoped_ptr<LayerTreeHost> layer_tree_host( | 89 scoped_ptr<LayerTreeHost> layer_tree_host( |
| 89 new LayerTreeHost(client, manager, settings)); | 90 new LayerTreeHost(client, manager, settings)); |
| 90 layer_tree_host->InitializeSingleThreaded(single_thread_client, | 91 layer_tree_host->InitializeSingleThreaded(single_thread_client, |
| 91 main_task_runner); | 92 main_task_runner, |
| 93 begin_frame_manager); |
| 92 return layer_tree_host.Pass(); | 94 return layer_tree_host.Pass(); |
| 93 } | 95 } |
| 94 | 96 |
| 95 LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, | 97 LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, |
| 96 SharedBitmapManager* manager, | 98 SharedBitmapManager* manager, |
| 97 const LayerTreeSettings& settings) | 99 const LayerTreeSettings& settings) |
| 98 : micro_benchmark_controller_(this), | 100 : micro_benchmark_controller_(this), |
| 99 next_ui_resource_id_(1), | 101 next_ui_resource_id_(1), |
| 100 animating_(false), | 102 animating_(false), |
| 101 needs_full_tree_sync_(true), | 103 needs_full_tree_sync_(true), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 131 | 133 |
| 132 void LayerTreeHost::InitializeThreaded( | 134 void LayerTreeHost::InitializeThreaded( |
| 133 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 135 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 134 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 136 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
| 135 InitializeProxy( | 137 InitializeProxy( |
| 136 ThreadProxy::Create(this, main_task_runner, impl_task_runner)); | 138 ThreadProxy::Create(this, main_task_runner, impl_task_runner)); |
| 137 } | 139 } |
| 138 | 140 |
| 139 void LayerTreeHost::InitializeSingleThreaded( | 141 void LayerTreeHost::InitializeSingleThreaded( |
| 140 LayerTreeHostSingleThreadClient* single_thread_client, | 142 LayerTreeHostSingleThreadClient* single_thread_client, |
| 141 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { | 143 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 144 BeginFrameManager* begin_frame_manager) { |
| 142 InitializeProxy( | 145 InitializeProxy( |
| 143 SingleThreadProxy::Create(this, single_thread_client, main_task_runner)); | 146 SingleThreadProxy::Create(this, |
| 147 single_thread_client, |
| 148 main_task_runner, |
| 149 begin_frame_manager)); |
| 144 } | 150 } |
| 145 | 151 |
| 146 void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) { | 152 void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) { |
| 147 InitializeProxy(proxy_for_testing.Pass()); | 153 InitializeProxy(proxy_for_testing.Pass()); |
| 148 } | 154 } |
| 149 | 155 |
| 150 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { | 156 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
| 151 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); | 157 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); |
| 152 | 158 |
| 153 proxy_ = proxy.Pass(); | 159 proxy_ = proxy.Pass(); |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 swap_promise_list_.push_back(swap_promise.Pass()); | 1295 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1290 } | 1296 } |
| 1291 | 1297 |
| 1292 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1298 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1293 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1299 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1294 swap_promise_list_[i]->DidNotSwap(reason); | 1300 swap_promise_list_[i]->DidNotSwap(reason); |
| 1295 swap_promise_list_.clear(); | 1301 swap_promise_list_.clear(); |
| 1296 } | 1302 } |
| 1297 | 1303 |
| 1298 } // namespace cc | 1304 } // namespace cc |
| OLD | NEW |