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

Unified Diff: cc/picture_layer_tiling.cc

Issue 11953005: cc: Update picture pile on tiles to prevent memory leak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename MoveTilePriorities to DidBecomeActive Created 7 years, 11 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/picture_layer_tiling.h ('k') | cc/picture_layer_tiling_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer_tiling.cc
diff --git a/cc/picture_layer_tiling.cc b/cc/picture_layer_tiling.cc
index 1b2668c00d1a6601a5b9e4e99a4fe638492f6712..1d16fc9901fa50fd7ad7b1c9525ca58919b59413 100644
--- a/cc/picture_layer_tiling.cc
+++ b/cc/picture_layer_tiling.cc
@@ -315,12 +315,18 @@ void PictureLayerTiling::UpdateTilePriorities(
}
}
-void PictureLayerTiling::MoveTilePriorities(WhichTree src_tree,
- WhichTree dst_tree) {
- DCHECK(src_tree != dst_tree);
+void PictureLayerTiling::DidBecomeActive() {
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- it->second->set_priority(dst_tree, it->second->priority(src_tree));
- it->second->set_priority(src_tree, TilePriority());
+ it->second->set_priority(ACTIVE_TREE, it->second->priority(PENDING_TREE));
+ it->second->set_priority(PENDING_TREE, TilePriority());
+
+ // Tile holds a ref onto a picture pile. If the tile never gets invalidated
+ // and recreated, then that picture pile ref could exist indefinitely. To
+ // prevent this, ask the client to update the pile to its own ref. This
+ // will cause PicturePileImpls and their clones to get deleted once the
+ // corresponding PictureLayerImpl and any in flight raster jobs go out of
+ // scope.
+ client_->UpdatePile(it->second);
}
}
« no previous file with comments | « cc/picture_layer_tiling.h ('k') | cc/picture_layer_tiling_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698