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

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: update 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 20a57b8a0723e2dfa9a386130b18c763ed2e62f7..549d3c880b8cfa173b32e8e9f0010f5156acc474 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -837,7 +837,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_in_content_space_),
skewport_in_content_space_(tiling_->current_skewport_),
@@ -851,8 +851,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;
@@ -867,16 +866,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) {
reveman 2014/07/24 16:38:49 nit: I would prefer a switch statement with all ph
vmpstr 2014/07/24 16:44:25 Can I push this nit off into the optimization patc
reveman 2014/07/24 16:54:18 sure, part of that patch is fine.
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_) {
@@ -887,7 +893,7 @@ void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() {
++spiral_iterator_;
}
- if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) {
+ if (!spiral_iterator_ && phase_ == EVENTUALLY_RECT) {
current_tile_ = NULL;
break;
}
@@ -900,8 +906,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();
@@ -909,27 +915,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