| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
| 14 #include "cc/layers/layer_collections.h" | 14 #include "cc/layers/layer_collections.h" |
| 15 #include "cc/layers/layer_impl.h" | 15 #include "cc/layers/layer_impl.h" |
| 16 #include "cc/trees/layer_tree.h" | |
| 17 #include "cc/trees/layer_tree_host.h" | 16 #include "cc/trees/layer_tree_host.h" |
| 18 #include "cc/trees/layer_tree_impl.h" | 17 #include "cc/trees/layer_tree_impl.h" |
| 19 | 18 |
| 20 namespace cc { | 19 namespace cc { |
| 21 | 20 |
| 22 template <typename LayerTreeType> | 21 template <typename LayerTreeType> |
| 23 void SynchronizeTreesInternal(LayerTreeType* source_tree, | 22 void SynchronizeTreesInternal(LayerTreeType* source_tree, |
| 24 LayerTreeImpl* tree_impl, | 23 LayerTreeImpl* tree_impl, |
| 25 PropertyTrees* property_trees) { | 24 PropertyTrees* property_trees) { |
| 26 DCHECK(tree_impl); | 25 DCHECK(tree_impl); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 &old_layer_map, source_tree->LayerById(id), tree_impl)); | 38 &old_layer_map, source_tree->LayerById(id), tree_impl)); |
| 40 tree_impl->AddLayer(std::move(layer_impl)); | 39 tree_impl->AddLayer(std::move(layer_impl)); |
| 41 } | 40 } |
| 42 } | 41 } |
| 43 | 42 |
| 44 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root, | 43 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root, |
| 45 LayerTreeImpl* tree_impl) { | 44 LayerTreeImpl* tree_impl) { |
| 46 if (!layer_root) { | 45 if (!layer_root) { |
| 47 tree_impl->DetachLayers(); | 46 tree_impl->DetachLayers(); |
| 48 } else { | 47 } else { |
| 49 SynchronizeTreesInternal(layer_root->GetLayerTree(), tree_impl, | 48 SynchronizeTreesInternal(layer_root->layer_tree_host(), tree_impl, |
| 50 layer_root->GetLayerTree()->property_trees()); | 49 layer_root->layer_tree_host()->property_trees()); |
| 51 } | 50 } |
| 52 } | 51 } |
| 53 | 52 |
| 54 void TreeSynchronizer::SynchronizeTrees(LayerTreeImpl* pending_tree, | 53 void TreeSynchronizer::SynchronizeTrees(LayerTreeImpl* pending_tree, |
| 55 LayerTreeImpl* active_tree) { | 54 LayerTreeImpl* active_tree) { |
| 56 if (pending_tree->LayerListIsEmpty()) { | 55 if (pending_tree->LayerListIsEmpty()) { |
| 57 active_tree->DetachLayers(); | 56 active_tree->DetachLayers(); |
| 58 } else { | 57 } else { |
| 59 SynchronizeTreesInternal(pending_tree, active_tree, | 58 SynchronizeTreesInternal(pending_tree, active_tree, |
| 60 pending_tree->property_trees()); | 59 pending_tree->property_trees()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 layer->PushPropertiesTo(layer_impl); | 97 layer->PushPropertiesTo(layer_impl); |
| 99 } | 98 } |
| 100 } | 99 } |
| 101 | 100 |
| 102 void TreeSynchronizer::PushLayerProperties(LayerTreeImpl* pending_tree, | 101 void TreeSynchronizer::PushLayerProperties(LayerTreeImpl* pending_tree, |
| 103 LayerTreeImpl* active_tree) { | 102 LayerTreeImpl* active_tree) { |
| 104 PushLayerPropertiesInternal(pending_tree->LayersThatShouldPushProperties(), | 103 PushLayerPropertiesInternal(pending_tree->LayersThatShouldPushProperties(), |
| 105 active_tree); | 104 active_tree); |
| 106 } | 105 } |
| 107 | 106 |
| 108 void TreeSynchronizer::PushLayerProperties(LayerTree* host_tree, | 107 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree, |
| 109 LayerTreeImpl* impl_tree) { | 108 LayerTreeImpl* impl_tree) { |
| 110 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), | 109 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), |
| 111 impl_tree); | 110 impl_tree); |
| 112 } | 111 } |
| 113 | 112 |
| 114 } // namespace cc | 113 } // namespace cc |
| OLD | NEW |