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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // An iterator class for walking over layers in the | 101 // An iterator class for walking over layers in the |
102 // RenderSurface-Layer tree. | 102 // RenderSurface-Layer tree. |
103 template <typename LayerType> | 103 template <typename LayerType> |
104 class LayerIterator { | 104 class LayerIterator { |
105 typedef LayerIterator<LayerType> LayerIteratorType; | 105 typedef LayerIterator<LayerType> LayerIteratorType; |
106 typedef typename LayerType::LayerListType LayerList; | 106 typedef typename LayerType::LayerListType LayerList; |
107 typedef typename LayerType::RenderSurfaceListType RenderSurfaceLayerList; | 107 typedef typename LayerType::RenderSurfaceListType RenderSurfaceLayerList; |
108 typedef typename LayerType::RenderSurfaceType RenderSurfaceType; | 108 typedef typename LayerType::RenderSurfaceType RenderSurfaceType; |
109 | 109 |
110 public: | 110 public: |
111 LayerIterator() : render_surface_layer_list_(NULL) {} | 111 LayerIterator() : render_surface_layer_list_(nullptr) {} |
112 | 112 |
113 static LayerIteratorType Begin( | 113 static LayerIteratorType Begin( |
114 const RenderSurfaceLayerList* render_surface_layer_list) { | 114 const RenderSurfaceLayerList* render_surface_layer_list) { |
115 return LayerIteratorType(render_surface_layer_list, true); | 115 return LayerIteratorType(render_surface_layer_list, true); |
116 } | 116 } |
117 static LayerIteratorType End( | 117 static LayerIteratorType End( |
118 const RenderSurfaceLayerList* render_surface_layer_list) { | 118 const RenderSurfaceLayerList* render_surface_layer_list) { |
119 return LayerIteratorType(render_surface_layer_list, false); | 119 return LayerIteratorType(render_surface_layer_list, false); |
120 } | 120 } |
121 | 121 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // this is a value from 0 to n-1 (n = number of children). | 287 // this is a value from 0 to n-1 (n = number of children). |
288 // Since the iterator must also stop at the layers representing | 288 // Since the iterator must also stop at the layers representing |
289 // the target surface, this is done by setting the current_layerIndex | 289 // the target surface, this is done by setting the current_layerIndex |
290 // to a value of LayerIteratorValue::LayerRepresentingTargetRenderSurface. | 290 // to a value of LayerIteratorValue::LayerRepresentingTargetRenderSurface. |
291 int current_layer_index_; | 291 int current_layer_index_; |
292 }; | 292 }; |
293 | 293 |
294 } // namespace cc | 294 } // namespace cc |
295 | 295 |
296 #endif // CC_LAYERS_LAYER_ITERATOR_H_ | 296 #endif // CC_LAYERS_LAYER_ITERATOR_H_ |
OLD | NEW |