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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 RemoveLayer(root_layer_for_testing_->id()); | 266 RemoveLayer(root_layer_for_testing_->id()); |
267 root_layer_for_testing_ = layer.get(); | 267 root_layer_for_testing_ = layer.get(); |
268 ClearLayerList(); | 268 ClearLayerList(); |
269 if (layer) { | 269 if (layer) { |
270 AddLayer(std::move(layer)); | 270 AddLayer(std::move(layer)); |
271 BuildLayerListForTesting(); | 271 BuildLayerListForTesting(); |
272 } | 272 } |
273 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 273 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
274 } | 274 } |
275 | 275 |
276 void LayerTreeImpl::SetRootLayerFromLayerListForTesting() { | |
277 root_layer_for_testing_ = layer_list_.empty() ? nullptr : layer_list_[0]; | |
278 } | |
279 | |
280 void LayerTreeImpl::OnCanDrawStateChangedForTree() { | 276 void LayerTreeImpl::OnCanDrawStateChangedForTree() { |
281 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 277 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
282 } | 278 } |
283 | 279 |
284 void LayerTreeImpl::AddToLayerList(LayerImpl* layer) { | 280 void LayerTreeImpl::AddToLayerList(LayerImpl* layer) { |
285 layer_list_.push_back(layer); | 281 layer_list_.push_back(layer); |
286 } | 282 } |
287 | 283 |
288 void LayerTreeImpl::ClearLayerList() { | 284 void LayerTreeImpl::ClearLayerList() { |
289 layer_list_.clear(); | 285 layer_list_.clear(); |
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 | 2093 |
2098 void LayerTreeImpl::ResetAllChangeTracking() { | 2094 void LayerTreeImpl::ResetAllChangeTracking() { |
2099 layers_that_should_push_properties_.clear(); | 2095 layers_that_should_push_properties_.clear(); |
2100 // Iterate over all layers, including masks and replicas. | 2096 // Iterate over all layers, including masks and replicas. |
2101 for (auto& layer : *layers_) | 2097 for (auto& layer : *layers_) |
2102 layer->ResetChangeTracking(); | 2098 layer->ResetChangeTracking(); |
2103 property_trees_.ResetAllChangeTracking(); | 2099 property_trees_.ResetAllChangeTracking(); |
2104 } | 2100 } |
2105 | 2101 |
2106 } // namespace cc | 2102 } // namespace cc |
OLD | NEW |