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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 555183002: cc: Fix layer raster tile iterator not to skip a tile erroneously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK, cleaned up unit test Created 6 years, 3 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/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),

Powered by Google App Engine
This is Rietveld 408576698