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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 current_layer_index_ = target_render_surface_children().size() - 1; | 244 current_layer_index_ = target_render_surface_children().size() - 1; |
245 | 245 |
246 target_render_surface()->target_render_surface_layer_index_history_ = | 246 target_render_surface()->target_render_surface_layer_index_history_ = |
247 previous_target_render_surface_layer; | 247 previous_target_render_surface_layer; |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 inline LayerType* current_layer() const { | 251 inline LayerType* current_layer() const { |
252 return current_layer_represents_target_render_surface() | 252 return current_layer_represents_target_render_surface() |
253 ? target_render_surface_layer() | 253 ? target_render_surface_layer() |
254 : LayerTreeHostCommon::get_child_as_raw_ptr( | 254 : LayerTreeHostCommon::get_layer_as_raw_ptr( |
255 target_render_surface_children(), current_layer_index_); | 255 target_render_surface_children(), current_layer_index_); |
256 } | 256 } |
257 | 257 |
258 inline bool current_layer_represents_contributing_render_surface() const { | 258 inline bool current_layer_represents_contributing_render_surface() const { |
259 return LayerTreeHostCommon::RenderSurfaceContributesToTarget<LayerType>( | 259 return LayerTreeHostCommon::RenderSurfaceContributesToTarget<LayerType>( |
260 current_layer(), target_render_surface_layer()->id()); | 260 current_layer(), target_render_surface_layer()->id()); |
261 } | 261 } |
262 inline bool current_layer_represents_target_render_surface() const { | 262 inline bool current_layer_represents_target_render_surface() const { |
263 return current_layer_index_ == | 263 return current_layer_index_ == |
264 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface; | 264 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface; |
(...skipping 22 matching lines...) Expand all 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 |