OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_LAYERS_LAYER_ITERATOR_H_ | 5 #ifndef CC_LAYERS_LAYER_ITERATOR_H_ |
6 #define CC_LAYERS_LAYER_ITERATOR_H_ | 6 #define CC_LAYERS_LAYER_ITERATOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/trees/layer_tree_host_common.h" | 10 #include "cc/trees/layer_tree_host_common.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // To use the iterators: | 77 // To use the iterators: |
78 // | 78 // |
79 // Create a stepping iterator and end iterator by calling | 79 // Create a stepping iterator and end iterator by calling |
80 // LayerIterator::Begin() and LayerIterator::End() and passing in the | 80 // LayerIterator::Begin() and LayerIterator::End() and passing in the |
81 // list of layers owning target RenderSurfaces. Step through the tree | 81 // list of layers owning target RenderSurfaces. Step through the tree |
82 // by incrementing the stepping iterator while it is != to | 82 // by incrementing the stepping iterator while it is != to |
83 // the end iterator. At each step the iterator knows what the layer | 83 // the end iterator. At each step the iterator knows what the layer |
84 // is representing, and you can query the iterator to decide | 84 // is representing, and you can query the iterator to decide |
85 // what actions to perform with the layer given what it represents. | 85 // what actions to perform with the layer given what it represents. |
86 | 86 |
87 ////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////// | 87 //////////////////////////////////////////////////////////////////////////////// |
88 | 88 |
89 // Non-templated constants | 89 // Non-templated constants |
90 struct LayerIteratorValue { | 90 struct LayerIteratorValue { |
91 static const int kInvalidTargetRenderSurfaceLayerIndex = -1; | 91 static const int kInvalidTargetRenderSurfaceLayerIndex = -1; |
92 // This must be -1 since the iterator action code assumes that this value can | 92 // This must be -1 since the iterator action code assumes that this value can |
93 // be reached by subtracting one from the position of the first layer in the | 93 // be reached by subtracting one from the position of the first layer in the |
94 // current target surface's child layer list, which is 0. | 94 // current target surface's child layer list, which is 0. |
95 static const int kLayerIndexRepresentingTargetRenderSurface = -1; | 95 static const int kLayerIndexRepresentingTargetRenderSurface = -1; |
96 }; | 96 }; |
97 | 97 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 typename RenderSurfaceType, | 301 typename RenderSurfaceType, |
302 typename ActionType> | 302 typename ActionType> |
303 void GoToHighestInSubtree( | 303 void GoToHighestInSubtree( |
304 LayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>* it); | 304 LayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>* it); |
305 }; | 305 }; |
306 }; | 306 }; |
307 | 307 |
308 } // namespace cc | 308 } // namespace cc |
309 | 309 |
310 #endif // CC_LAYERS_LAYER_ITERATOR_H_ | 310 #endif // CC_LAYERS_LAYER_ITERATOR_H_ |
OLD | NEW |