Index: cc/layers/picture_layer_impl.cc |
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
index cb8141b66b83d56a7f334ef4cdbaea4717d172f2..05dab30694d2ddc9d27f57d15a2a22586bda13a4 100644 |
--- a/cc/layers/picture_layer_impl.cc |
+++ b/cc/layers/picture_layer_impl.cc |
@@ -1568,7 +1568,7 @@ PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator( |
IteratorType index = stages_[current_stage_].iterator_type; |
TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
if (!iterators_[index] || iterators_[index].get_type() != tile_type) |
- ++(*this); |
+ AdvanceToNextStage(); |
} |
PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} |
@@ -1584,22 +1584,13 @@ operator++() { |
TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
// First advance the iterator. |
- if (iterators_[index]) |
- ++iterators_[index]; |
- |
- if (iterators_[index] && iterators_[index].get_type() == tile_type) |
- return *this; |
+ DCHECK(iterators_[index]); |
+ DCHECK(iterators_[index].get_type() == tile_type); |
+ ++iterators_[index]; |
- // Next, advance the stage. |
- ++current_stage_; |
- while (current_stage_ < arraysize(stages_)) { |
- index = stages_[current_stage_].iterator_type; |
- tile_type = stages_[current_stage_].tile_type; |
+ if (!iterators_[index] || iterators_[index].get_type() != tile_type) |
+ AdvanceToNextStage(); |
- if (iterators_[index] && iterators_[index].get_type() == tile_type) |
- break; |
- ++current_stage_; |
- } |
return *this; |
} |
@@ -1623,6 +1614,19 @@ const Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() const { |
return *iterators_[index]; |
} |
+void PictureLayerImpl::LayerRasterTileIterator::AdvanceToNextStage() { |
+ DCHECK_LT(current_stage_, arraysize(stages_)); |
+ ++current_stage_; |
+ while (current_stage_ < arraysize(stages_)) { |
+ IteratorType index = stages_[current_stage_].iterator_type; |
+ TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
+ |
+ if (iterators_[index] && iterators_[index].get_type() == tile_type) |
+ break; |
+ ++current_stage_; |
+ } |
+} |
+ |
PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator() |
: layer_(NULL), |
tree_priority_(SAME_PRIORITY_FOR_BOTH_TREES), |