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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 413053004: cc: Fix tiling raster iterator to process all tiles correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/resources/picture_layer_tiling.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index 38ae160ad904bf5fb33fdc7ebe8c4de761896e3f..eac7ec4e889ec1d8cfd55df96a6f156a95b4db7b 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -840,7 +840,7 @@ PictureLayerTiling::TilingRasterTileIterator::TilingRasterTileIterator(
PictureLayerTiling* tiling,
WhichTree tree)
: tiling_(tiling),
- type_(TilePriority::NOW),
+ phase_(VISIBLE_RECT),
visible_rect_in_content_space_(tiling_->current_visible_rect_),
skewport_in_content_space_(tiling_->current_skewport_rect_),
eventually_rect_in_content_space_(tiling_->current_eventually_rect_),
@@ -853,8 +853,7 @@ PictureLayerTiling::TilingRasterTileIterator::TilingRasterTileIterator(
spiral_iterator_(&tiling->tiling_data_,
skewport_in_content_space_,
visible_rect_in_content_space_,
- visible_rect_in_content_space_),
- skewport_processed_(false) {
+ visible_rect_in_content_space_) {
if (!visible_iterator_) {
AdvancePhase();
return;
@@ -869,16 +868,23 @@ PictureLayerTiling::TilingRasterTileIterator::TilingRasterTileIterator(
PictureLayerTiling::TilingRasterTileIterator::~TilingRasterTileIterator() {}
void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() {
- DCHECK_LT(type_, TilePriority::EVENTUALLY);
+ DCHECK_LT(phase_, EVENTUALLY_RECT);
do {
- type_ = static_cast<TilePriority::PriorityBin>(type_ + 1);
- if (type_ == TilePriority::EVENTUALLY) {
+ phase_ = static_cast<Phase>(phase_ + 1);
+
+ if (phase_ == SOON_BORDER_RECT) {
spiral_iterator_ = TilingData::SpiralDifferenceIterator(
&tiling_->tiling_data_,
- eventually_rect_in_content_space_,
+ soon_border_rect_in_content_space_,
skewport_in_content_space_,
visible_rect_in_content_space_);
+ } else if (phase_ == EVENTUALLY_RECT) {
+ spiral_iterator_ = TilingData::SpiralDifferenceIterator(
+ &tiling_->tiling_data_,
+ eventually_rect_in_content_space_,
+ skewport_in_content_space_,
+ soon_border_rect_in_content_space_);
}
while (spiral_iterator_) {
@@ -889,7 +895,7 @@ void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() {
++spiral_iterator_;
}
- if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) {
+ if (!spiral_iterator_ && phase_ == EVENTUALLY_RECT) {
current_tile_ = NULL;
break;
}
@@ -902,8 +908,8 @@ operator++() {
current_tile_ = NULL;
while (!current_tile_ || !TileNeedsRaster(current_tile_)) {
std::pair<int, int> next_index;
- switch (type_) {
- case TilePriority::NOW:
+ switch (phase_) {
+ case VISIBLE_RECT:
++visible_iterator_;
if (!visible_iterator_) {
AdvancePhase();
@@ -911,27 +917,16 @@ operator++() {
}
next_index = visible_iterator_.index();
break;
- case TilePriority::SOON:
+ case SKEWPORT_RECT:
+ case SOON_BORDER_RECT:
++spiral_iterator_;
if (!spiral_iterator_) {
- if (skewport_processed_) {
- AdvancePhase();
- return *this;
- }
- skewport_processed_ = true;
- spiral_iterator_ = TilingData::SpiralDifferenceIterator(
- &tiling_->tiling_data_,
- soon_border_rect_in_content_space_,
- skewport_in_content_space_,
- visible_rect_in_content_space_);
- if (!spiral_iterator_) {
- AdvancePhase();
- return *this;
- }
+ AdvancePhase();
+ return *this;
}
next_index = spiral_iterator_.index();
break;
- case TilePriority::EVENTUALLY:
+ case EVENTUALLY_RECT:
++spiral_iterator_;
if (!spiral_iterator_) {
current_tile_ = NULL;
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698