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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 674103004: [WIP] cc: Use reverse spiral iterator in tiling eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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') | cc/layers/picture_layer_impl_unittest.cc » ('j') | 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 6d8914033e1d43802052d9f9302bb656a1b9e657..fe58d2a618996b479f3875eeea91d85dd4441f85 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1567,6 +1567,7 @@ void PictureLayerImpl::LayerRasterTileIterator::AdvanceToNextStage() {
PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator()
: layer_(nullptr),
tree_priority_(SAME_PRIORITY_FOR_BOTH_TREES),
+ layer_has_twin_layer_(false),
current_category_(PictureLayerTiling::EVENTUALLY),
current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES),
current_tiling_(0u) {
@@ -1577,6 +1578,7 @@ PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator(
TreePriority tree_priority)
: layer_(layer),
tree_priority_(tree_priority),
+ layer_has_twin_layer_(!!layer->GetPendingOrActiveTwinLayer()),
current_category_(PictureLayerTiling::EVENTUALLY),
current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES),
current_tiling_(0u) {
@@ -1590,9 +1592,8 @@ PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator(
break;
current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator(
- layer_->tilings_->tiling_at(CurrentTilingIndex()),
- tree_priority,
- current_category_);
+ layer_->tilings_->tiling_at(CurrentTilingIndex()), tree_priority,
+ current_category_, layer_has_twin_layer_);
} while (!current_iterator_);
}
@@ -1619,9 +1620,8 @@ operator++() {
break;
current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator(
- layer_->tilings_->tiling_at(CurrentTilingIndex()),
- tree_priority_,
- current_category_);
+ layer_->tilings_->tiling_at(CurrentTilingIndex()), tree_priority_,
+ current_category_, layer_has_twin_layer_);
}
return *this;
}
@@ -1633,10 +1633,15 @@ PictureLayerImpl::LayerEvictionTileIterator::operator bool() const {
bool PictureLayerImpl::LayerEvictionTileIterator::AdvanceToNextCategory() {
switch (current_category_) {
case PictureLayerTiling::EVENTUALLY:
+ if (!layer_->HasValidTilePriorities() &&
+ layer_->GetTree() == PENDING_TREE)
+ return false;
current_category_ =
PictureLayerTiling::EVENTUALLY_AND_REQUIRED_FOR_ACTIVATION;
return true;
case PictureLayerTiling::EVENTUALLY_AND_REQUIRED_FOR_ACTIVATION:
+ if (!layer_->HasValidTilePriorities())
+ return false;
current_category_ = PictureLayerTiling::SOON;
return true;
case PictureLayerTiling::SOON:
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698