diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 00:52:21 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 00:52:21 +0000 |
commit | ec927b359384520cd79dc87d20483c6223e89557 (patch) | |
tree | d7708c3db71aa90180fbc49b3507605130dffc3b /cc/resources/picture_layer_tiling.cc | |
parent | b0470117cf90ec137a732704daa6b18addfd4c06 (diff) | |
download | chromium_src-ec927b359384520cd79dc87d20483c6223e89557.zip chromium_src-ec927b359384520cd79dc87d20483c6223e89557.tar.gz chromium_src-ec927b359384520cd79dc87d20483c6223e89557.tar.bz2 |
cc: Remove invalidated recycle tree tiles on activation.
This patch is the first part of ensuring that recycle tree does not
contain any unshared tiles.
This is done by ensuring that we invalidate the soon to become recycled
tiling while activating.
BUG=393802
R=danakj
Review URL: https://codereview.chromium.org/397303003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture_layer_tiling.cc')
-rw-r--r-- | cc/resources/picture_layer_tiling.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc index a3b154b..fdfbad9 100644 --- a/cc/resources/picture_layer_tiling.cc +++ b/cc/resources/picture_layer_tiling.cc @@ -180,7 +180,18 @@ void PictureLayerTiling::UpdateTilesToCurrentPile( it->second->set_picture_pile(pile); } +void PictureLayerTiling::RemoveTilesInRegion(const Region& layer_region) { + bool recreate_invalidated_tiles = false; + DoInvalidate(layer_region, recreate_invalidated_tiles); +} + void PictureLayerTiling::Invalidate(const Region& layer_region) { + bool recreate_invalidated_tiles = true; + DoInvalidate(layer_region, recreate_invalidated_tiles); +} + +void PictureLayerTiling::DoInvalidate(const Region& layer_region, + bool recreate_invalidated_tiles) { std::vector<TileMapKey> new_tile_keys; gfx::Rect expanded_live_tiles_rect = tiling_data_.ExpandRectIgnoringBordersToTileBoundsWithBorders( @@ -208,14 +219,11 @@ void PictureLayerTiling::Invalidate(const Region& layer_region) { } } - if (!new_tile_keys.empty()) { - const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this); + if (recreate_invalidated_tiles && !new_tile_keys.empty()) { for (size_t i = 0; i < new_tile_keys.size(); ++i) { // Don't try to share a tile with the twin layer, it's been invalidated so // we have to make our own tile here. - // TODO(danakj): Because we have two frames of invalidation during sync - // this isn't always true. When sync is gone we can do this again. - // PictureLayerTiling* twin_tiling = NULL; + const PictureLayerTiling* twin_tiling = NULL; CreateTile(new_tile_keys[i].first, new_tile_keys[i].second, twin_tiling); } } |