summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_picture_layer_impl.h
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-01-27 20:09:28 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-28 04:10:46 +0000
commit5c115e7db2f2845b5fe4a687dc33d5f2340b5d60 (patch)
treeb057c5c3bf152030feaefc3138046bc139e40e06 /cc/test/fake_picture_layer_impl.h
parent7810214e0a59d622add492497b61f5fa70b69d78 (diff)
downloadchromium_src-5c115e7db2f2845b5fe4a687dc33d5f2340b5d60.zip
chromium_src-5c115e7db2f2845b5fe4a687dc33d5f2340b5d60.tar.gz
chromium_src-5c115e7db2f2845b5fe4a687dc33d5f2340b5d60.tar.bz2
cc: Clean up tilings in UpdateTiles as well as in AppendQuads.
Sometimes we get into situations where we get frequent UpdateTiles, but no AppendQuads. As a result we can start accumulating tilings (during pinch zoom for example), but we never free any of them, since the code to free tilings happens only during AppendQuads. This patch remedies this by ensuring that if AppendQuads doesn't clean up the tilings, and we've added some since last time we ran UpdateTiles, we clean them up. R=danakj BUG=452304 Review URL: https://codereview.chromium.org/881083002 Cr-Commit-Position: refs/heads/master@{#313428}
Diffstat (limited to 'cc/test/fake_picture_layer_impl.h')
-rw-r--r--cc/test/fake_picture_layer_impl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h
index a0e16e8..b34cd3e 100644
--- a/cc/test/fake_picture_layer_impl.h
+++ b/cc/test/fake_picture_layer_impl.h
@@ -121,6 +121,14 @@ class FakePictureLayerImpl : public PictureLayerImpl {
void ResetAllTilesPriorities();
PictureLayerTilingSet* GetTilings() { return tilings_.get(); }
+ // Add the given tiling as a "used" tiling during AppendQuads. This ensures
+ // that future calls to UpdateTiles don't delete the tiling.
+ void MarkAllTilingsUsed() {
+ last_append_quads_tilings_.clear();
+ for (size_t i = 0; i < tilings_->num_tilings(); ++i)
+ last_append_quads_tilings_.push_back(tilings_->tiling_at(i));
+ }
+
size_t release_resources_count() const { return release_resources_count_; }
void reset_release_resources_count() { release_resources_count_ = 0; }