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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 246673005: cc: Start using raster/eviction iterators in tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index d2a732d9eb985e12d15a71405dde751458eb14b2..fc33acf5eb7356e60aa0db5e46af3e95c2d3a718 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -772,6 +772,8 @@ void PictureLayerTiling::UpdateEvictionCacheIfNeeded(
eviction_tiles_cache_.clear();
eviction_tiles_cache_.reserve(tiles_.size());
for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
+ DCHECK(it->second);
+
// TODO(vmpstr): This should update the priority if UpdateTilePriorities
// changes not to do this.
eviction_tiles_cache_.push_back(it->second);
@@ -818,6 +820,21 @@ PictureLayerTiling::TilingRasterTileIterator::TilingRasterTileIterator(
PictureLayerTiling::TilingRasterTileIterator::~TilingRasterTileIterator() {}
+bool
+PictureLayerTiling::TilingRasterTileIterator::HasTilesRequiredForActivation()
+ const {
+ if (!*this || get_type() != TilePriority::NOW)
+ return false;
+
+ for (TilingData::Iterator it = visible_iterator_; it; ++it) {
+ std::pair<int, int> next_index = visible_iterator_.index();
+ Tile* tile = tiling_->TileAt(next_index.first, next_index.second);
+ if (tile && tile->required_for_activation())
+ return true;
+ }
+ return false;
+}
+
void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() {
DCHECK_LT(type_, TilePriority::EVENTUALLY);

Powered by Google App Engine
This is Rietveld 408576698