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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 366113002: cc: Do not cleanup tiles with raster tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated review comments + reset tile priority from tiling. 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 | « no previous file | cc/resources/tile.h » ('j') | cc/resources/tile_manager.cc » ('J')
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 fdfbad9f62e3e60bbd1949541123ef36c5713de1..87e264b471c413e96023188999d4b6aa1ea0a602 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -94,6 +94,11 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale,
}
PictureLayerTiling::~PictureLayerTiling() {
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
+ Tile* tile = it->second.get();
+ tile->SetPriority(ACTIVE_TREE, TilePriority());
+ tile->SetPriority(PENDING_TREE, TilePriority());
reveman 2014/07/24 13:36:24 I don't think you can reset both pending and activ
sohanjg 2014/07/24 15:01:55 If we reset the priority of only the pending tree
vmpstr 2014/07/24 16:19:21 Since at this point the tile can be shared on both
sohanjg 2014/07/25 09:38:26 Done.
+ }
}
void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) {
@@ -214,6 +219,13 @@ void PictureLayerTiling::DoInvalidate(const Region& layer_region,
TileMap::iterator find = tiles_.find(key);
if (find == tiles_.end())
continue;
+
+ // Reset priority as tile is ref-counted and might still be used
+ // even though we no longer hold a reference to it here anymore.
+ Tile* tile = find->second.get();
+ tile->SetPriority(ACTIVE_TREE, TilePriority());
+ tile->SetPriority(PENDING_TREE, TilePriority());
reveman 2014/07/24 13:36:24 same here. resetting both active and pending prior
sohanjg 2014/07/25 09:38:26 Done.
+
tiles_.erase(find);
new_tile_keys.push_back(key);
}
@@ -598,8 +610,12 @@ void PictureLayerTiling::SetLiveTilesRect(
TileMap::iterator found = tiles_.find(key);
// If the tile was outside of the recorded region, it won't exist even
// though it was in the live rect.
- if (found != tiles_.end())
+ if (found != tiles_.end()) {
+ Tile* tile = found->second.get();
+ tile->SetPriority(ACTIVE_TREE, TilePriority());
+ tile->SetPriority(PENDING_TREE, TilePriority());
reveman 2014/07/24 13:36:24 and here. resetting both active and pending priori
sohanjg 2014/07/25 09:38:26 Done.
tiles_.erase(found);
+ }
}
const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
« no previous file with comments | « no previous file | cc/resources/tile.h » ('j') | cc/resources/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698