| 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 #ifndef CC_TREES_TREE_SYNCHRONIZER_H_ | 5 #ifndef CC_TREES_TREE_SYNCHRONIZER_H_ |
| 6 #define CC_TREES_TREE_SYNCHRONIZER_H_ | 6 #define CC_TREES_TREE_SYNCHRONIZER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class LayerImpl; | 14 class LayerImpl; |
| 15 class LayerTreeHost; |
| 15 class LayerTreeImpl; | 16 class LayerTreeImpl; |
| 16 class Layer; | 17 class Layer; |
| 17 | 18 |
| 18 class CC_EXPORT TreeSynchronizer { | 19 class CC_EXPORT TreeSynchronizer { |
| 19 public: | 20 public: |
| 20 // Accepts a Layer tree and returns a reference to a LayerImpl tree that | 21 // Accepts a Layer tree and returns a reference to a LayerImpl tree that |
| 21 // duplicates the structure of the Layer tree, reusing the LayerImpls in the | 22 // duplicates the structure of the Layer tree, reusing the LayerImpls in the |
| 22 // tree provided by old_layer_impl_root if possible. | 23 // tree provided by old_layer_impl_root if possible. |
| 23 static scoped_ptr<LayerImpl> SynchronizeTrees( | 24 static scoped_ptr<LayerImpl> SynchronizeTrees( |
| 24 Layer* layer_root, | 25 Layer* layer_root, |
| 25 scoped_ptr<LayerImpl> old_layer_impl_root, | 26 scoped_ptr<LayerImpl> old_layer_impl_root, |
| 26 LayerTreeImpl* tree_impl); | 27 LayerTreeImpl* tree_impl); |
| 27 static scoped_ptr<LayerImpl> SynchronizeTrees( | 28 static scoped_ptr<LayerImpl> SynchronizeTrees( |
| 28 LayerImpl* layer_root, | 29 LayerImpl* layer_root, |
| 29 scoped_ptr<LayerImpl> old_layer_impl_root, | 30 scoped_ptr<LayerImpl> old_layer_impl_root, |
| 30 LayerTreeImpl* tree_impl); | 31 LayerTreeImpl* tree_impl); |
| 31 | 32 static void PushLayerProperties(LayerTreeImpl* pending_tree, |
| 32 // Pushes properties from a Layer or LayerImpl tree to a structurally | 33 LayerTreeImpl* active_tree); |
| 33 // equivalent LayerImpl tree. | 34 static void PushLayerProperties(LayerTreeHost* host_tree, |
| 34 static void PushProperties(Layer* layer_root, | 35 LayerTreeImpl* impl_tree); |
| 35 LayerImpl* layer_impl_root); | |
| 36 static void PushProperties(LayerImpl* layer_root, LayerImpl* layer_impl_root); | |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 TreeSynchronizer(); // Not instantiable. | 38 TreeSynchronizer(); // Not instantiable. |
| 40 | 39 |
| 41 static void PushPropertiesInternal( | |
| 42 Layer* layer, | |
| 43 LayerImpl* layer_impl, | |
| 44 int* num_dependents_need_push_properties_for_parent); | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(TreeSynchronizer); | 40 DISALLOW_COPY_AND_ASSIGN(TreeSynchronizer); |
| 47 }; | 41 }; |
| 48 | 42 |
| 49 } // namespace cc | 43 } // namespace cc |
| 50 | 44 |
| 51 #endif // CC_TREES_TREE_SYNCHRONIZER_H_ | 45 #endif // CC_TREES_TREE_SYNCHRONIZER_H_ |
| OLD | NEW |