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 "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/trees/layer_tree_host_common.h" | 9 #include "cc/trees/layer_tree_host_common.h" |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // by incrementing the stepping iterator while it is != to | 75 // by incrementing the stepping iterator while it is != to |
76 // the end iterator. At each step the iterator knows what the layer | 76 // the end iterator. At each step the iterator knows what the layer |
77 // is representing, and you can query the iterator to decide | 77 // is representing, and you can query the iterator to decide |
78 // what actions to perform with the layer given what it represents. | 78 // what actions to perform with the layer given what it represents. |
79 | 79 |
80 //////////////////////////////////////////////////////////////////////////////// | 80 //////////////////////////////////////////////////////////////////////////////// |
81 | 81 |
82 // Non-templated constants | 82 // Non-templated constants |
83 struct LayerIteratorValue { | 83 struct LayerIteratorValue { |
84 static const int kInvalidTargetRenderSurfaceLayerIndex = -1; | 84 static const int kInvalidTargetRenderSurfaceLayerIndex = -1; |
85 // This must be -1 since the iterator action code assumes that this value can | 85 // This must be (size_t)-1 since the iterator action code assumes that this |
86 // be reached by subtracting one from the position of the first layer in the | 86 // value can be reached by subtracting one from the position of the first |
87 // current target surface's child layer list, which is 0. | 87 // layer in the current target surface's child layer list, which is 0. |
88 static const int kLayerIndexRepresentingTargetRenderSurface = -1; | 88 static const size_t kLayerIndexRepresentingTargetRenderSurface = |
| 89 static_cast<size_t>(-1); |
89 }; | 90 }; |
90 | 91 |
91 // The position of a layer iterator that is independent | 92 // The position of a layer iterator that is independent |
92 // of its many template types. | 93 // of its many template types. |
93 template <typename LayerType> struct LayerIteratorPosition { | 94 template <typename LayerType> struct LayerIteratorPosition { |
94 bool represents_target_render_surface; | 95 bool represents_target_render_surface; |
95 bool represents_contributing_render_surface; | 96 bool represents_contributing_render_surface; |
96 bool represents_itself; | 97 bool represents_itself; |
97 LayerType* target_render_surface_layer; | 98 LayerType* target_render_surface_layer; |
98 LayerType* current_layer; | 99 LayerType* current_layer; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // owns the current target surface. This is a value from 0 to n-1 | 280 // owns the current target surface. This is a value from 0 to n-1 |
280 // (n = size of render_surface_layer_list = number of surfaces). | 281 // (n = size of render_surface_layer_list = number of surfaces). |
281 // A value outside of this range | 282 // A value outside of this range |
282 // (for example, LayerIteratorValue::kInvalidTargetRenderSurfaceLayerIndex) | 283 // (for example, LayerIteratorValue::kInvalidTargetRenderSurfaceLayerIndex) |
283 // is used to indicate a position outside the bounds of the tree. | 284 // is used to indicate a position outside the bounds of the tree. |
284 int target_render_surface_layer_index_; | 285 int target_render_surface_layer_index_; |
285 // A position in the list of layers that are children of the | 286 // A position in the list of layers that are children of the |
286 // current target surface. When pointing to one of these layers, | 287 // current target surface. When pointing to one of these layers, |
287 // this is a value from 0 to n-1 (n = number of children). | 288 // this is a value from 0 to n-1 (n = number of children). |
288 // Since the iterator must also stop at the layers representing | 289 // Since the iterator must also stop at the layers representing |
289 // the target surface, this is done by setting the current_layerIndex | 290 // the target surface, this is done by setting the current_layer_index |
290 // to a value of LayerIteratorValue::LayerRepresentingTargetRenderSurface. | 291 // to a value of |
291 int current_layer_index_; | 292 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface. |
| 293 size_t current_layer_index_; |
292 }; | 294 }; |
293 | 295 |
294 } // namespace cc | 296 } // namespace cc |
295 | 297 |
296 #endif // CC_LAYERS_LAYER_ITERATOR_H_ | 298 #endif // CC_LAYERS_LAYER_ITERATOR_H_ |
OLD | NEW |