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

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

Issue 2690753002: cc: Move render surface ownership from layers to the effect tree (Closed)
Patch Set: Only update surfaces when can_render_to_separate_surface changes Created 3 years, 10 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/layers/layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl.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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 : target_render_surface_children().at(current_layer_index_); 249 : target_render_surface_children().at(current_layer_index_);
250 } 250 }
251 251
252 inline bool current_layer_represents_contributing_render_surface() const { 252 inline bool current_layer_represents_contributing_render_surface() const {
253 return current_layer()->render_surface() && 253 RenderSurfaceImpl* render_surface = current_layer()->render_surface();
254 current_layer()->render_surface() != target_render_surface(); 254 return render_surface && render_surface != target_render_surface();
255 } 255 }
256 inline bool current_layer_represents_target_render_surface() const { 256 inline bool current_layer_represents_target_render_surface() const {
257 return current_layer_index_ == 257 return current_layer_index_ ==
258 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface; 258 LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface;
259 } 259 }
260 260
261 inline RenderSurfaceImpl* target_render_surface() const { 261 inline RenderSurfaceImpl* target_render_surface() const {
262 return target_render_surface_layer()->render_surface(); 262 return target_render_surface_layer()->render_surface();
263 } 263 }
264 inline const LayerImplList& target_render_surface_children() const { 264 inline const LayerImplList& target_render_surface_children() const {
(...skipping 17 matching lines...) Expand all
282 // Since the iterator must also stop at the layers representing 282 // Since the iterator must also stop at the layers representing
283 // 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
284 // to a value of 284 // to a value of
285 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface. 285 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface.
286 size_t current_layer_index_; 286 size_t current_layer_index_;
287 }; 287 };
288 288
289 } // namespace cc 289 } // namespace cc
290 290
291 #endif // CC_LAYERS_LAYER_ITERATOR_H_ 291 #endif // CC_LAYERS_LAYER_ITERATOR_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698