| 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/tree_synchronizer.h" | 5 #include "cc/trees/tree_synchronizer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 LayerTreeType* host, | 77 LayerTreeType* host, |
| 78 LayerTreeImpl* tree_impl) { | 78 LayerTreeImpl* tree_impl) { |
| 79 tree_impl->ClearLayerList(); | 79 tree_impl->ClearLayerList(); |
| 80 for (auto* layer : *host) { | 80 for (auto* layer : *host) { |
| 81 std::unique_ptr<LayerImpl> layer_impl( | 81 std::unique_ptr<LayerImpl> layer_impl( |
| 82 ReuseOrCreateLayerImpl(old_layers, layer, tree_impl)); | 82 ReuseOrCreateLayerImpl(old_layers, layer, tree_impl)); |
| 83 | 83 |
| 84 tree_impl->AddToLayerList(layer_impl.get()); | 84 tree_impl->AddToLayerList(layer_impl.get()); |
| 85 tree_impl->AddLayer(std::move(layer_impl)); | 85 tree_impl->AddLayer(std::move(layer_impl)); |
| 86 } | 86 } |
| 87 tree_impl->SetRootLayerFromLayerList(); | 87 tree_impl->OnCanDrawStateChangedForTree(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 template <typename LayerType> | 90 template <typename LayerType> |
| 91 static void PushLayerPropertiesInternal( | 91 static void PushLayerPropertiesInternal( |
| 92 std::unordered_set<LayerType*> layers_that_should_push_properties, | 92 std::unordered_set<LayerType*> layers_that_should_push_properties, |
| 93 LayerTreeImpl* impl_tree) { | 93 LayerTreeImpl* impl_tree) { |
| 94 for (auto layer : layers_that_should_push_properties) { | 94 for (auto layer : layers_that_should_push_properties) { |
| 95 LayerImpl* layer_impl = impl_tree->LayerById(layer->id()); | 95 LayerImpl* layer_impl = impl_tree->LayerById(layer->id()); |
| 96 DCHECK(layer_impl); | 96 DCHECK(layer_impl); |
| 97 layer->PushPropertiesTo(layer_impl); | 97 layer->PushPropertiesTo(layer_impl); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 void TreeSynchronizer::PushLayerProperties(LayerTreeImpl* pending_tree, | 101 void TreeSynchronizer::PushLayerProperties(LayerTreeImpl* pending_tree, |
| 102 LayerTreeImpl* active_tree) { | 102 LayerTreeImpl* active_tree) { |
| 103 PushLayerPropertiesInternal(pending_tree->LayersThatShouldPushProperties(), | 103 PushLayerPropertiesInternal(pending_tree->LayersThatShouldPushProperties(), |
| 104 active_tree); | 104 active_tree); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree, | 107 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree, |
| 108 LayerTreeImpl* impl_tree) { | 108 LayerTreeImpl* impl_tree) { |
| 109 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), | 109 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), |
| 110 impl_tree); | 110 impl_tree); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace cc | 113 } // namespace cc |
| OLD | NEW |