cc: Always keep the PictureLayerImpl::twin_layer_ pointer valid.
commit7b08e2869cf7f6a93503ffe66998244ea66b55e7
authordanakj <danakj@chromium.org>
Mon, 27 Oct 2014 20:29:59 +0000 (27 13:29 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 27 Oct 2014 20:30:16 +0000 (27 20:30 +0000)
tree67615b6005fd678943409a3f59190ac1c2382400
parent9e6e5fb1be5ae176050065d7a6c09e4afb44c168
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}
17 files changed:
cc/debug/rasterize_and_record_benchmark_impl.cc
cc/layers/picture_layer_impl.cc
cc/layers/picture_layer_impl.h
cc/layers/picture_layer_impl_unittest.cc
cc/resources/picture_layer_tiling.cc
cc/resources/picture_layer_tiling.h
cc/resources/tile_manager_unittest.cc
cc/test/fake_picture_layer_impl.cc
cc/test/fake_picture_layer_impl.h
cc/test/fake_picture_layer_tiling_client.cc
cc/test/fake_picture_layer_tiling_client.h
cc/trees/layer_tree_host_impl.cc
cc/trees/layer_tree_host_impl.h
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_host_unittest_picture.cc
cc/trees/layer_tree_impl.cc
cc/trees/layer_tree_impl.h