Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: cc/layers/layer_iterator.h

Issue 1869983003: cc: Clean up helper function from layer tree host common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@targetid
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/debug/debug_rect_history.cc ('k') | cc/trees/damage_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 current_layer_index_ = target_render_surface_children().size() - 1; 239 current_layer_index_ = target_render_surface_children().size() - 1;
240 240
241 target_render_surface()->target_render_surface_layer_index_history_ = 241 target_render_surface()->target_render_surface_layer_index_history_ =
242 previous_target_render_surface_layer; 242 previous_target_render_surface_layer;
243 } 243 }
244 } 244 }
245 245
246 inline LayerImpl* current_layer() const { 246 inline LayerImpl* current_layer() const {
247 return current_layer_represents_target_render_surface() 247 return current_layer_represents_target_render_surface()
248 ? target_render_surface_layer() 248 ? target_render_surface_layer()
249 : LayerTreeHostCommon::get_layer_as_raw_ptr( 249 : target_render_surface_children().at(current_layer_index_);
250 target_render_surface_children(), current_layer_index_);
251 } 250 }
252 251
253 inline bool current_layer_represents_contributing_render_surface() const { 252 inline bool current_layer_represents_contributing_render_surface() const {
254 return LayerTreeHostCommon::RenderSurfaceContributesToTarget<LayerImpl>( 253 return current_layer()->render_surface() &&
255 current_layer(), target_render_surface_layer()->id()); 254 current_layer()->render_surface() != target_render_surface();
256 } 255 }
257 inline bool current_layer_represents_target_render_surface() const { 256 inline bool current_layer_represents_target_render_surface() const {
258 return current_layer_index_ == 257 return current_layer_index_ ==
259 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface; 258 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface;
260 } 259 }
261 260
262 inline RenderSurfaceImpl* target_render_surface() const { 261 inline RenderSurfaceImpl* target_render_surface() const {
263 return target_render_surface_layer()->render_surface(); 262 return target_render_surface_layer()->render_surface();
264 } 263 }
265 inline const LayerImplList& target_render_surface_children() const { 264 inline const LayerImplList& target_render_surface_children() const {
(...skipping 17 matching lines...) Expand all
283 // Since the iterator must also stop at the layers representing 282 // Since the iterator must also stop at the layers representing
284 // the target surface, this is done by setting the current_layer_index 283 // the target surface, this is done by setting the current_layer_index
285 // to a value of 284 // to a value of
286 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface. 285 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface.
287 size_t current_layer_index_; 286 size_t current_layer_index_;
288 }; 287 };
289 288
290 } // namespace cc 289 } // namespace cc
291 290
292 #endif // CC_LAYERS_LAYER_ITERATOR_H_ 291 #endif // CC_LAYERS_LAYER_ITERATOR_H_
OLDNEW
« no previous file with comments | « cc/debug/debug_rect_history.cc ('k') | cc/trees/damage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698