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 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 | 2074 |
2068 void LayerTreeImpl::ResetAllChangeTracking() { | 2075 void LayerTreeImpl::ResetAllChangeTracking() { |
2069 layers_that_should_push_properties_.clear(); | 2076 layers_that_should_push_properties_.clear(); |
2070 // Iterate over all layers, including masks. | 2077 // Iterate over all layers, including masks. |
2071 for (auto& layer : *layers_) | 2078 for (auto& layer : *layers_) |
2072 layer->ResetChangeTracking(); | 2079 layer->ResetChangeTracking(); |
2073 property_trees_.ResetAllChangeTracking(); | 2080 property_trees_.ResetAllChangeTracking(); |
2074 } | 2081 } |
2075 | 2082 |
2076 } // namespace cc | 2083 } // namespace cc |
OLD | NEW |