| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 void LayerTreeHost::NotifyInputThrottledUntilCommit() { | 664 void LayerTreeHost::NotifyInputThrottledUntilCommit() { |
| 665 proxy_->NotifyInputThrottledUntilCommit(); | 665 proxy_->NotifyInputThrottledUntilCommit(); |
| 666 } | 666 } |
| 667 | 667 |
| 668 void LayerTreeHost::LayoutAndUpdateLayers() { | 668 void LayerTreeHost::LayoutAndUpdateLayers() { |
| 669 DCHECK(!proxy_->HasImplThread()); | 669 DCHECK(!proxy_->HasImplThread()); |
| 670 // This function is only valid when not using the scheduler. | 670 // This function is only valid when not using the scheduler. |
| 671 DCHECK(!settings_.single_thread_proxy_scheduler); | 671 DCHECK(!settings_.single_thread_proxy_scheduler); |
| 672 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); | 672 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); |
| 673 | 673 |
| 674 proxy->LayoutAndUpdateLayers(); | 674 if (output_surface_lost()) { |
| 675 proxy->RequestNewOutputSurface(); |
| 676 // RequestNewOutputSurface could have synchronously created an output |
| 677 // surface, so check again before returning. |
| 678 if (output_surface_lost()) |
| 679 return; |
| 680 } |
| 681 |
| 682 Layout(); |
| 683 UpdateLayers(); |
| 675 } | 684 } |
| 676 | 685 |
| 677 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { | 686 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { |
| 678 DCHECK(!proxy_->HasImplThread()); | 687 DCHECK(!proxy_->HasImplThread()); |
| 679 // This function is only valid when not using the scheduler. | 688 // This function is only valid when not using the scheduler. |
| 680 DCHECK(!settings_.single_thread_proxy_scheduler); | 689 DCHECK(!settings_.single_thread_proxy_scheduler); |
| 681 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); | 690 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); |
| 682 | 691 |
| 683 proxy->CompositeImmediately(frame_begin_time); | 692 proxy->CompositeImmediately(frame_begin_time); |
| 684 } | 693 } |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) | 1229 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) |
| 1221 : false; | 1230 : false; |
| 1222 } | 1231 } |
| 1223 | 1232 |
| 1224 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { | 1233 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { |
| 1225 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) | 1234 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) |
| 1226 : false; | 1235 : false; |
| 1227 } | 1236 } |
| 1228 | 1237 |
| 1229 } // namespace cc | 1238 } // namespace cc |
| OLD | NEW |