diff options
author | danakj <danakj@chromium.org> | 2014-10-27 13:29:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 20:30:16 +0000 |
commit | 7b08e2869cf7f6a93503ffe66998244ea66b55e7 (patch) | |
tree | 67615b6005fd678943409a3f59190ac1c2382400 /cc/layers/picture_layer_impl.h | |
parent | 9e6e5fb1be5ae176050065d7a6c09e4afb44c168 (diff) | |
download | chromium_src-7b08e2869cf7f6a93503ffe66998244ea66b55e7.zip chromium_src-7b08e2869cf7f6a93503ffe66998244ea66b55e7.tar.gz chromium_src-7b08e2869cf7f6a93503ffe66998244ea66b55e7.tar.bz2 |
cc: Always keep the PictureLayerImpl::twin_layer_ pointer valid.
We currently null the twin_layer_ pointer when pushing to the active
tree and then using hashmap lookups to find the recycled twin, and
reconnecting the pointers in DoPostCommitInitializationIfNeeded().
Instead, we can leave the pointers always valid and use Getter methods
that check what tree the twin is on to decide if we should consider it
a pending twin or a recycle twin.
This means that during commit the pending layer will be able to find
its active twin when it updates its picture pile, so that it can share
tiles that are not invalidated. (Previously it wouldn't know about its
twin until after commit, when we set it up and then did SyncTilings.)
This allows us to have a more straightforward flow of data, setting up
the pending tilings when we give it a pile from the main thread
instead of doing it at some hazy future time (usually inside
UpdateDrawProperties).
R=enne, vmpstr
BUG=407418,387116,427213
Committed: https://crrev.com/11f13546fd3ee3d53921c23861bf970bd2bb6428
Cr-Commit-Position: refs/heads/master@{#301155}
Review URL: https://codereview.chromium.org/676953003
Cr-Commit-Position: refs/heads/master@{#301432}
Diffstat (limited to 'cc/layers/picture_layer_impl.h')
-rw-r--r-- | cc/layers/picture_layer_impl.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h index 0bc2558..9350dc8 100644 --- a/cc/layers/picture_layer_impl.h +++ b/cc/layers/picture_layer_impl.h @@ -122,7 +122,7 @@ class CC_EXPORT PictureLayerImpl PicturePileImpl* GetPile() override; gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; const Region* GetPendingInvalidation() override; - const PictureLayerTiling* GetTwinTiling( + const PictureLayerTiling* GetPendingOrActiveTwinTiling( const PictureLayerTiling* tiling) const override; PictureLayerTiling* GetRecycledTwinTiling( const PictureLayerTiling* tiling) override; @@ -144,7 +144,7 @@ class CC_EXPORT PictureLayerImpl void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; // Functions used by tile manager. - PictureLayerImpl* GetTwinLayer() { return twin_layer_; } + PictureLayerImpl* GetPendingOrActiveTwinLayer() const; bool IsOnActiveOrPendingTree() const; // Virtual for testing. virtual bool HasValidTilePriorities() const; @@ -168,7 +168,7 @@ class CC_EXPORT PictureLayerImpl float SnappedContentsScale(float new_contents_scale); void ResetRasterScale(); gfx::Rect GetViewportForTilePriorityInContentSpace() const; - PictureLayerImpl* GetRecycledTwinLayer(); + PictureLayerImpl* GetRecycledTwinLayer() const; void DoPostCommitInitializationIfNeeded() { if (needs_post_commit_initialization_) |