| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 DCHECK_EQ(layer_list_[i], *it); | 117 DCHECK_EQ(layer_list_[i], *it); |
| 118 } | 118 } |
| 119 #endif | 119 #endif |
| 120 | 120 |
| 121 if (!LayerListIsEmpty()) { | 121 if (!LayerListIsEmpty()) { |
| 122 LayerTreeHostCommon::CallFunctionForEveryLayer( | 122 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 123 this, [](LayerImpl* layer) { layer->ReleaseResources(); }); | 123 this, [](LayerImpl* layer) { layer->ReleaseResources(); }); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void LayerTreeImpl::RecreateResources() { | 127 void LayerTreeImpl::ReleaseTileResources() { |
| 128 if (!LayerListIsEmpty()) { | 128 if (!LayerListIsEmpty()) { |
| 129 LayerTreeHostCommon::CallFunctionForEveryLayer( | 129 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 130 this, [](LayerImpl* layer) { layer->RecreateResources(); }); | 130 this, [](LayerImpl* layer) { layer->ReleaseTileResources(); }); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 void LayerTreeImpl::RecreateTileResources() { |
| 135 if (!LayerListIsEmpty()) { |
| 136 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 137 this, [](LayerImpl* layer) { layer->RecreateTileResources(); }); |
| 138 } |
| 139 } |
| 140 |
| 134 bool LayerTreeImpl::IsViewportLayerId(int id) const { | 141 bool LayerTreeImpl::IsViewportLayerId(int id) const { |
| 135 if (id == inner_viewport_scroll_layer_id_ || | 142 if (id == inner_viewport_scroll_layer_id_ || |
| 136 id == outer_viewport_scroll_layer_id_) | 143 id == outer_viewport_scroll_layer_id_) |
| 137 return true; | 144 return true; |
| 138 if (InnerViewportContainerLayer() && | 145 if (InnerViewportContainerLayer() && |
| 139 id == InnerViewportContainerLayer()->id()) | 146 id == InnerViewportContainerLayer()->id()) |
| 140 return true; | 147 return true; |
| 141 if (OuterViewportContainerLayer() && | 148 if (OuterViewportContainerLayer() && |
| 142 id == OuterViewportContainerLayer()->id()) | 149 id == OuterViewportContainerLayer()->id()) |
| 143 return true; | 150 return true; |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 | 2084 |
| 2078 void LayerTreeImpl::ResetAllChangeTracking() { | 2085 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2079 layers_that_should_push_properties_.clear(); | 2086 layers_that_should_push_properties_.clear(); |
| 2080 // Iterate over all layers, including masks. | 2087 // Iterate over all layers, including masks. |
| 2081 for (auto& layer : *layers_) | 2088 for (auto& layer : *layers_) |
| 2082 layer->ResetChangeTracking(); | 2089 layer->ResetChangeTracking(); |
| 2083 property_trees_.ResetAllChangeTracking(); | 2090 property_trees_.ResetAllChangeTracking(); |
| 2084 } | 2091 } |
| 2085 | 2092 |
| 2086 } // namespace cc | 2093 } // namespace cc |
| OLD | NEW |