diff options
author | sohan.jyoti@samsung.com <sohan.jyoti@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-04 08:43:47 +0000 |
---|---|---|
committer | sohan.jyoti@samsung.com <sohan.jyoti@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-04 08:43:47 +0000 |
commit | 317fd0c6267fd2d4e1e941b00a4951207205026b (patch) | |
tree | 60aef551e07fc5d7bbe05f6e227e355210464a29 /cc/resources/picture_layer_tiling.cc | |
parent | 81b6f8373298eb4d7389661c177083a54b597866 (diff) | |
download | chromium_src-317fd0c6267fd2d4e1e941b00a4951207205026b.zip chromium_src-317fd0c6267fd2d4e1e941b00a4951207205026b.tar.gz chromium_src-317fd0c6267fd2d4e1e941b00a4951207205026b.tar.bz2 |
cc: Do not cleanup tiles with raster tasks.
During cleanup, this keeps the tiles around until the
associated raster tasks completes running on the worker thread.
We reset the priority of the tile on the tree it lies before
dropping it.
BUG=386039
Review URL: https://codereview.chromium.org/366113002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture_layer_tiling.cc')
-rw-r--r-- | cc/resources/picture_layer_tiling.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc index 2809d70..79af4e9 100644 --- a/cc/resources/picture_layer_tiling.cc +++ b/cc/resources/picture_layer_tiling.cc @@ -58,6 +58,13 @@ class TileEvictionOrder { private: TreePriority tree_priority_; }; + +void ReleaseTile(Tile* tile, WhichTree tree) { + // 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->SetPriority(tree, TilePriority()); +} + } // namespace scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( @@ -99,6 +106,8 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale, } PictureLayerTiling::~PictureLayerTiling() { + for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) + ReleaseTile(it->second.get(), client_->GetTree()); } void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) { @@ -219,6 +228,9 @@ void PictureLayerTiling::DoInvalidate(const Region& layer_region, TileMap::iterator find = tiles_.find(key); if (find == tiles_.end()) continue; + + ReleaseTile(find->second.get(), client_->GetTree()); + tiles_.erase(find); new_tile_keys.push_back(key); } @@ -614,8 +626,10 @@ 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()) { + ReleaseTile(found->second.get(), client_->GetTree()); tiles_.erase(found); + } } const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this); |