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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 502453003: cc: Remove tiles from recycle tree that were deleted on active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't maintain recycled twin Created 6 years, 4 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') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | 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 3d132e162c7aca32e1b41ff875808962933fab50..bbc6ba2b1545d7e8613881a9ce1e5fe12c8b61bc 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -607,6 +607,15 @@ void PictureLayerTiling::UpdateTilePriorities(
current_eventually_rect_ = eventually_rect;
}
+void PictureLayerTiling::RemoveTileAt(int i, int j) {
+ TileMapKey key(i, j);
+ TileMap::iterator found = tiles_.find(key);
+ if (found == tiles_.end())
+ return;
+ ReleaseTile(found->second.get(), client_->GetTree());
+ tiles_.erase(found);
+}
+
void PictureLayerTiling::SetLiveTilesRect(
const gfx::Rect& new_live_tiles_rect) {
DCHECK(new_live_tiles_rect.IsEmpty() ||
@@ -617,6 +626,7 @@ void PictureLayerTiling::SetLiveTilesRect(
return;
// Iterate to delete all tiles outside of our new live_tiles rect.
+ PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this);
for (TilingData::DifferenceIterator iter(&tiling_data_,
live_tiles_rect_,
new_live_tiles_rect);
@@ -629,6 +639,8 @@ void PictureLayerTiling::SetLiveTilesRect(
if (found != tiles_.end()) {
ReleaseTile(found->second.get(), client_->GetTree());
tiles_.erase(found);
+ if (recycled_twin)
+ recycled_twin->RemoveTileAt(iter.index_x(), iter.index_y());
}
}
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698