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

Unified Diff: cc/layers/layer_iterator.h

Issue 1158433010: Reland: 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer_iterator.h
diff --git a/cc/layers/layer_iterator.h b/cc/layers/layer_iterator.h
index ba5c6aa5da50cf8c3ef4ac93d9db4edf9f526b88..cd8da6833398724f79e52da0370d11004f9ecc65 100644
--- a/cc/layers/layer_iterator.h
+++ b/cc/layers/layer_iterator.h
@@ -82,10 +82,11 @@ namespace cc {
// Non-templated constants
struct LayerIteratorValue {
static const int kInvalidTargetRenderSurfaceLayerIndex = -1;
- // This must be -1 since the iterator action code assumes that this value can
- // be reached by subtracting one from the position of the first layer in the
- // current target surface's child layer list, which is 0.
- static const int kLayerIndexRepresentingTargetRenderSurface = -1;
+ // This must be (size_t)-1 since the iterator action code assumes that this
+ // value can be reached by subtracting one from the position of the first
+ // layer in the current target surface's child layer list, which is 0.
+ static const size_t kLayerIndexRepresentingTargetRenderSurface =
+ static_cast<size_t>(-1);
};
// The position of a layer iterator that is independent
@@ -286,9 +287,10 @@ class LayerIterator {
// current target surface. When pointing to one of these layers,
// this is a value from 0 to n-1 (n = number of children).
// Since the iterator must also stop at the layers representing
- // the target surface, this is done by setting the current_layerIndex
- // to a value of LayerIteratorValue::LayerRepresentingTargetRenderSurface.
- int current_layer_index_;
+ // the target surface, this is done by setting the current_layer_index
+ // to a value of
+ // LayerIteratorValue::kLayerIndexRepresentingTargetRenderSurface.
+ size_t current_layer_index_;
};
} // namespace cc
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/output/direct_renderer.cc » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698