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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 413603002: cc: Add const versions of operator* to layer iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 4a7e0c0b0b66ae5bdf20743b65c0f51c69824c0d..ee9abc64bd15586e377110fd52c9df8cda19a1ee 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1508,6 +1508,16 @@ Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() {
return *iterators_[index];
}
+const Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() const {
+ DCHECK(*this);
+
+ IteratorType index = stages_[current_stage_].iterator_type;
+ DCHECK(iterators_[index]);
+ DCHECK(iterators_[index].get_type() == stages_[current_stage_].tile_type);
+
+ return *iterators_[index];
+}
+
PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator()
: iterator_index_(0),
iteration_stage_(TilePriority::EVENTUALLY),
@@ -1585,6 +1595,11 @@ Tile* PictureLayerImpl::LayerEvictionTileIterator::operator*() {
return *iterators_[iterator_index_];
}
+const Tile* PictureLayerImpl::LayerEvictionTileIterator::operator*() const {
+ DCHECK(*this);
+ return *iterators_[iterator_index_];
+}
+
PictureLayerImpl::LayerEvictionTileIterator&
PictureLayerImpl::LayerEvictionTileIterator::
operator++() {
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698