| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root, | 43 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root, |
| 44 LayerTreeImpl* tree_impl) { | 44 LayerTreeImpl* tree_impl) { |
| 45 if (!layer_root) { | 45 if (!layer_root) { |
| 46 tree_impl->DetachLayers(); | 46 tree_impl->DetachLayers(); |
| 47 } else { | 47 } else { |
| 48 SynchronizeTreesInternal(layer_root->layer_tree_host(), tree_impl, | 48 SynchronizeTreesInternal(layer_root->layer_tree_host(), tree_impl, |
| 49 layer_root->layer_tree_host()->property_trees()); | 49 layer_root->layer_tree_host()->property_trees()); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 void TreeSynchronizer::SynchronizeTrees(LayerImpl* layer_root, | 53 void TreeSynchronizer::SynchronizeTrees(LayerTreeImpl* pending_tree, |
| 54 LayerTreeImpl* tree_impl) { | 54 LayerTreeImpl* active_tree) { |
| 55 if (!layer_root) { | 55 if (pending_tree->LayerListIsEmpty()) { |
| 56 tree_impl->DetachLayers(); | 56 active_tree->DetachLayers(); |
| 57 } else { | 57 } else { |
| 58 SynchronizeTreesInternal(layer_root->layer_tree_impl(), tree_impl, | 58 SynchronizeTreesInternal(pending_tree, active_tree, |
| 59 layer_root->layer_tree_impl()->property_trees()); | 59 pending_tree->property_trees()); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 template <typename LayerType> | 63 template <typename LayerType> |
| 64 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers, | 64 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers, |
| 65 LayerType* layer, | 65 LayerType* layer, |
| 66 LayerTreeImpl* tree_impl) { | 66 LayerTreeImpl* tree_impl) { |
| 67 if (!layer) | 67 if (!layer) |
| 68 return nullptr; | 68 return nullptr; |
| 69 std::unique_ptr<LayerImpl> layer_impl = std::move((*old_layers)[layer->id()]); | 69 std::unique_ptr<LayerImpl> layer_impl = std::move((*old_layers)[layer->id()]); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |