| 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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 proxy_->NotifyInputThrottledUntilCommit(); | 721 proxy_->NotifyInputThrottledUntilCommit(); |
| 722 } | 722 } |
| 723 | 723 |
| 724 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { | 724 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { |
| 725 DCHECK(!proxy_->HasImplThread()); | 725 DCHECK(!proxy_->HasImplThread()); |
| 726 // This function is only valid when not using the scheduler. | 726 // This function is only valid when not using the scheduler. |
| 727 DCHECK(!settings_.single_thread_proxy_scheduler); | 727 DCHECK(!settings_.single_thread_proxy_scheduler); |
| 728 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); | 728 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); |
| 729 | 729 |
| 730 SetLayerTreeHostClientReady(); | 730 SetLayerTreeHostClientReady(); |
| 731 if (output_surface_lost_) { | |
| 732 proxy->RequestNewOutputSurface(); | |
| 733 // RequestNewOutputSurface could have synchronously created an output | |
| 734 // surface, so check again before returning. | |
| 735 if (output_surface_lost_) | |
| 736 return; | |
| 737 } | |
| 738 | |
| 739 proxy->CompositeImmediately(frame_begin_time); | 731 proxy->CompositeImmediately(frame_begin_time); |
| 740 } | 732 } |
| 741 | 733 |
| 742 bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue) { | 734 bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue) { |
| 743 DCHECK(!output_surface_lost_); | 735 DCHECK(!output_surface_lost_); |
| 744 | 736 |
| 745 if (!root_layer()) | 737 if (!root_layer()) |
| 746 return false; | 738 return false; |
| 747 | 739 |
| 748 DCHECK(!root_layer()->parent()); | 740 DCHECK(!root_layer()->parent()); |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 swap_promise_list_.push_back(swap_promise.Pass()); | 1332 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1341 } | 1333 } |
| 1342 | 1334 |
| 1343 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1335 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1344 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1336 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1345 swap_promise_list_[i]->DidNotSwap(reason); | 1337 swap_promise_list_[i]->DidNotSwap(reason); |
| 1346 swap_promise_list_.clear(); | 1338 swap_promise_list_.clear(); |
| 1347 } | 1339 } |
| 1348 | 1340 |
| 1349 } // namespace cc | 1341 } // namespace cc |
| OLD | NEW |