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

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

Issue 1155553006: Revert of cc: Fix size_t to int truncations in layers/ output/ playback/ quads/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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.cc ('k') | cc/output/direct_renderer.cc » ('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 "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
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 (size_t)-1 since the iterator action code assumes that this 85 // This must be -1 since the iterator action code assumes that this value can
86 // value can be reached by subtracting one from the position of the first 86 // be reached by subtracting one from the position of the first layer in the
87 // layer in the current target surface's child layer list, which is 0. 87 // current target surface's child layer list, which is 0.
88 static const size_t kLayerIndexRepresentingTargetRenderSurface = 88 static const int kLayerIndexRepresentingTargetRenderSurface = -1;
89 static_cast<size_t>(-1);
90 }; 89 };
91 90
92 // The position of a layer iterator that is independent 91 // The position of a layer iterator that is independent
93 // of its many template types. 92 // of its many template types.
94 template <typename LayerType> struct LayerIteratorPosition { 93 template <typename LayerType> struct LayerIteratorPosition {
95 bool represents_target_render_surface; 94 bool represents_target_render_surface;
96 bool represents_contributing_render_surface; 95 bool represents_contributing_render_surface;
97 bool represents_itself; 96 bool represents_itself;
98 LayerType* target_render_surface_layer; 97 LayerType* target_render_surface_layer;
99 LayerType* current_layer; 98 LayerType* current_layer;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // owns the current target surface. This is a value from 0 to n-1 279 // owns the current target surface. This is a value from 0 to n-1
281 // (n = size of render_surface_layer_list = number of surfaces). 280 // (n = size of render_surface_layer_list = number of surfaces).
282 // A value outside of this range 281 // A value outside of this range
283 // (for example, LayerIteratorValue::kInvalidTargetRenderSurfaceLayerIndex) 282 // (for example, LayerIteratorValue::kInvalidTargetRenderSurfaceLayerIndex)
284 // is used to indicate a position outside the bounds of the tree. 283 // is used to indicate a position outside the bounds of the tree.
285 int target_render_surface_layer_index_; 284 int target_render_surface_layer_index_;
286 // A position in the list of layers that are children of the 285 // A position in the list of layers that are children of the
287 // current target surface. When pointing to one of these layers, 286 // current target surface. When pointing to one of these layers,
288 // 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).
289 // Since the iterator must also stop at the layers representing 288 // Since the iterator must also stop at the layers representing
290 // the target surface, this is done by setting the current_layer_index 289 // the target surface, this is done by setting the current_layerIndex
291 // to a value of 290 // to a value of LayerIteratorValue::LayerRepresentingTargetRenderSurface.
292 // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface. 291 int current_layer_index_;
293 size_t current_layer_index_;
294 }; 292 };
295 293
296 } // namespace cc 294 } // namespace cc
297 295
298 #endif // CC_LAYERS_LAYER_ITERATOR_H_ 296 #endif // CC_LAYERS_LAYER_ITERATOR_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698