| 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 float LayerTreeHostImpl::VerticalAdjust() const { | 1621 float LayerTreeHostImpl::VerticalAdjust() const { |
| 1622 if (!active_tree_->InnerViewportContainerLayer()) | 1622 if (!active_tree_->InnerViewportContainerLayer()) |
| 1623 return 0; | 1623 return 0; |
| 1624 | 1624 |
| 1625 return active_tree_->InnerViewportContainerLayer()->BoundsDelta().y(); | 1625 return active_tree_->InnerViewportContainerLayer()->BoundsDelta().y(); |
| 1626 } | 1626 } |
| 1627 | 1627 |
| 1628 void LayerTreeHostImpl::DidLoseOutputSurface() { | 1628 void LayerTreeHostImpl::DidLoseOutputSurface() { |
| 1629 #ifndef NDEBUG |
| 1630 // This must be set before calling the below functions as they may |
| 1631 // synchronously try to recreate the output surface. |
| 1632 did_lose_called_ = true; |
| 1633 #endif |
| 1629 if (resource_provider_) | 1634 if (resource_provider_) |
| 1630 resource_provider_->DidLoseOutputSurface(); | 1635 resource_provider_->DidLoseOutputSurface(); |
| 1631 // TODO(jamesr): The renderer_ check is needed to make some of the | 1636 // TODO(jamesr): The renderer_ check is needed to make some of the |
| 1632 // LayerTreeHostContextTest tests pass, but shouldn't be necessary (or | 1637 // LayerTreeHostContextTest tests pass, but shouldn't be necessary (or |
| 1633 // important) in production. We should adjust the test to not need this. | 1638 // important) in production. We should adjust the test to not need this. |
| 1634 if (renderer_) | 1639 if (renderer_) |
| 1635 client_->DidLoseOutputSurfaceOnImplThread(); | 1640 client_->DidLoseOutputSurfaceOnImplThread(); |
| 1636 #if DCHECK_IS_ON | |
| 1637 did_lose_called_ = true; | |
| 1638 #endif | |
| 1639 } | 1641 } |
| 1640 | 1642 |
| 1641 bool LayerTreeHostImpl::HaveRootScrollLayer() const { | 1643 bool LayerTreeHostImpl::HaveRootScrollLayer() const { |
| 1642 return !!InnerViewportScrollLayer(); | 1644 return !!InnerViewportScrollLayer(); |
| 1643 } | 1645 } |
| 1644 | 1646 |
| 1645 LayerImpl* LayerTreeHostImpl::RootLayer() const { | 1647 LayerImpl* LayerTreeHostImpl::RootLayer() const { |
| 1646 return active_tree_->root_layer(); | 1648 return active_tree_->root_layer(); |
| 1647 } | 1649 } |
| 1648 | 1650 |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3148 } | 3150 } |
| 3149 | 3151 |
| 3150 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3152 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3151 std::vector<PictureLayerImpl*>::iterator it = | 3153 std::vector<PictureLayerImpl*>::iterator it = |
| 3152 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3154 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3153 DCHECK(it != picture_layers_.end()); | 3155 DCHECK(it != picture_layers_.end()); |
| 3154 picture_layers_.erase(it); | 3156 picture_layers_.erase(it); |
| 3155 } | 3157 } |
| 3156 | 3158 |
| 3157 } // namespace cc | 3159 } // namespace cc |
| OLD | NEW |