cc: Always keep the PictureLayerImpl::twin_layer_ pointer valid.
commit11f13546fd3ee3d53921c23861bf970bd2bb6428
authordanakj <danakj@chromium.org>
Fri, 24 Oct 2014 18:50:40 +0000 (24 11:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 24 Oct 2014 18:51:08 +0000 (24 18:51 +0000)
tree2b737e7749af988d2acc0a9ebe458c659d246089
parent0e2deda3f0c59c8fc18323ede48a552bef341c24
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

Review URL: https://codereview.chromium.org/676953003

Cr-Commit-Position: refs/heads/master@{#301155}
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