summaryrefslogtreecommitdiffstats
path: root/cc/resources/picture_layer_tiling_set.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 22:44:51 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 22:44:51 +0000
commit6398904bbfab1f98e4235ac94d505dfeefef4d57 (patch)
tree887fb8530465b213462a956626ecee0186b5e477 /cc/resources/picture_layer_tiling_set.h
parentb7c7b162ed000cf9d11ac4fb645d497101570e1a (diff)
downloadchromium_src-6398904bbfab1f98e4235ac94d505dfeefef4d57.zip
chromium_src-6398904bbfab1f98e4235ac94d505dfeefef4d57.tar.gz
chromium_src-6398904bbfab1f98e4235ac94d505dfeefef4d57.tar.bz2
cc: Recycle tilings to make SetLiveTilesRect cheaper
Rather than recreating new tilings every frame, use the tilings and old tiles from the recycle tree in order to prevent excessive amounts of tile allocations (1 per tile) during the first update. In order to reuse a tiling from two frames ago, the tilings must be resized, invalidated, have their pile updated, and also any missing tiles that can now be rastered need to be filled in. This brings back a bunch of functions that were removed in https://codereview.chromium.org/14600003/ to enable tilings to be resized and updated at times other than SetLiveTilesRect. This patch makes SetLiveTilesRect on the pending tree go from 2.2ms to 0.16ms on average on an N4 for the heavy page linked in the bug with ~700 tiles. On a page with about 300 tiles and fewer commits, this patch is a slight win but is mostly in the noise. This is an updated reland of https://codereview.chromium.org/16888016, which got rolled out previously. R=danakj@chromium.org BUG=248954 Review URL: https://chromiumcodereview.appspot.com/18326013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture_layer_tiling_set.h')
-rw-r--r--cc/resources/picture_layer_tiling_set.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/cc/resources/picture_layer_tiling_set.h b/cc/resources/picture_layer_tiling_set.h
index f8264c4..e498cb9 100644
--- a/cc/resources/picture_layer_tiling_set.h
+++ b/cc/resources/picture_layer_tiling_set.h
@@ -19,9 +19,16 @@ class CC_EXPORT PictureLayerTilingSet {
~PictureLayerTilingSet();
void SetClient(PictureLayerTilingClient* client);
+ const PictureLayerTilingClient* client() const { return client_; }
- void AddTilingsToMatchScales(
+ // Make this set of tilings match the same set of content scales from |other|.
+ // Delete any tilings that don't meet |minimum_contents_scale|. Recreate
+ // any tiles that intersect |layer_invalidation|. Update the size of all
+ // tilings to |new_layer_bounds|.
+ void SyncTilings(
const PictureLayerTilingSet& other,
+ gfx::Size new_layer_bounds,
+ const Region& layer_invalidation,
float minimum_contents_scale);
gfx::Size layer_bounds() const { return layer_bounds_; }
@@ -35,6 +42,8 @@ class CC_EXPORT PictureLayerTilingSet {
return tilings_[idx];
}
+ PictureLayerTiling* TilingAtScale(float scale) const;
+
// Remove all tilings.
void RemoveAllTilings();