Chromium Code Reviews| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 133 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 134 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 134 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
| 135 InitializeProxy( | 135 InitializeProxy( |
| 136 ThreadProxy::Create(this, main_task_runner, impl_task_runner)); | 136 ThreadProxy::Create(this, main_task_runner, impl_task_runner)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void LayerTreeHost::InitializeSingleThreaded( | 139 void LayerTreeHost::InitializeSingleThreaded( |
| 140 LayerTreeHostSingleThreadClient* single_thread_client, | 140 LayerTreeHostSingleThreadClient* single_thread_client, |
| 141 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { | 141 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { |
| 142 InitializeProxy( | 142 InitializeProxy( |
| 143 SingleThreadProxy::Create(this, single_thread_client, main_task_runner)); | 143 SingleThreadProxy::Create(this, |
| 144 single_thread_client, | |
| 145 main_task_runner)); | |
| 144 } | 146 } |
| 145 | 147 |
| 146 void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) { | 148 void LayerTreeHost::InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing) { |
| 147 InitializeProxy(proxy_for_testing.Pass()); | 149 InitializeProxy(proxy_for_testing.Pass()); |
| 148 } | 150 } |
| 149 | 151 |
| 150 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { | 152 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
| 151 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); | 153 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); |
| 152 | 154 |
| 153 proxy_ = proxy.Pass(); | 155 proxy_ = proxy.Pass(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 return host_impl.Pass(); | 432 return host_impl.Pass(); |
| 431 } | 433 } |
| 432 | 434 |
| 433 void LayerTreeHost::DidLoseOutputSurface() { | 435 void LayerTreeHost::DidLoseOutputSurface() { |
| 434 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); | 436 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); |
| 435 DCHECK(proxy_->IsMainThread()); | 437 DCHECK(proxy_->IsMainThread()); |
| 436 | 438 |
| 437 if (output_surface_lost_) | 439 if (output_surface_lost_) |
| 438 return; | 440 return; |
| 439 | 441 |
| 442 client_->DidLoseOutputSurface(); | |
|
brianderson
2014/09/04 18:45:46
Why is this needed?
| |
| 443 | |
| 440 num_failed_recreate_attempts_ = 0; | 444 num_failed_recreate_attempts_ = 0; |
| 441 output_surface_lost_ = true; | 445 output_surface_lost_ = true; |
| 442 SetNeedsCommit(); | 446 SetNeedsCommit(); |
| 443 } | 447 } |
| 444 | 448 |
| 445 void LayerTreeHost::FinishAllRendering() { | 449 void LayerTreeHost::FinishAllRendering() { |
| 446 proxy_->FinishAllRendering(); | 450 proxy_->FinishAllRendering(); |
| 447 } | 451 } |
| 448 | 452 |
| 449 void LayerTreeHost::SetDeferCommits(bool defer_commits) { | 453 void LayerTreeHost::SetDeferCommits(bool defer_commits) { |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1288 DCHECK(swap_promise); | 1292 DCHECK(swap_promise); |
| 1289 swap_promise_list_.push_back(swap_promise.Pass()); | 1293 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1290 } | 1294 } |
| 1291 | 1295 |
| 1292 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1296 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1293 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1297 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1294 swap_promise_list_[i]->DidNotSwap(reason); | 1298 swap_promise_list_[i]->DidNotSwap(reason); |
| 1295 swap_promise_list_.clear(); | 1299 swap_promise_list_.clear(); |
| 1296 } | 1300 } |
| 1297 | 1301 |
| 1302 void LayerTreeHost::SetAuthoritativeVSyncInterval(base::TimeDelta interval) { | |
| 1303 proxy_->SetAuthoritativeVSyncInterval(interval); | |
| 1304 } | |
| 1305 | |
| 1306 void LayerTreeHost::SetChildrenNeedBeginFrames(bool need_begin_frame) { | |
| 1307 proxy_->SetChildrenNeedBeginFrames(need_begin_frame); | |
| 1308 } | |
| 1309 | |
| 1310 void LayerTreeHost::SendBeginFrameToChildren(const BeginFrameArgs& args) { | |
| 1311 client_->SendBeginFrameToChildren(args); | |
| 1312 } | |
| 1313 | |
| 1298 } // namespace cc | 1314 } // namespace cc |
| OLD | NEW |