Support swap promises that are pinned to a particular layer tree.
commit2e02f73e17f4fc3f611a08582b7944bb32362a2f
authortobiasjs <tobiasjs@chromium.org>
Wed, 2 Sep 2015 12:08:03 +0000 (2 05:08 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 2 Sep 2015 12:08:37 +0000 (2 12:08 +0000)
tree3ec8063fc9f44fe20b1e77343d14503d45242344
parent5bb9337f661b52f6298d59c1aba5cc100677dd0b
Support swap promises that are pinned to a particular layer tree.

A pinned swap promise queued on a pending tree will only see
DidActivate() or DidNotSwap(ACTIVATION_FAILS). It is not passed
to the active tree, so it will not swap.

A pinned swap promise on the active tree will either see only
DidSwap() or DidNotSwap(SWAP_FAILS). No DidActivate() will be
seen because that has already happened prior to queueing of the
swap promise.

Conversely, an unpinned swap promise (queued by
QueueSwapPromise()) travels with the layer information currently
associated with the tree. For example, when a pending tree is
activated, the swap promise is passed to the active tree along
with the layer information. Similarly, when a new activation
overwrites layer information on the active tree, queued swap
promises are broken.

This allows us to break unpinned swap promises on the active tree
at the point at which we activate the pending tree without
changing latency measurement.

BUG=498824
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#346894}
cc/layers/surface_layer_unittest.cc
cc/trees/latency_info_swap_promise_monitor.cc
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_host_unittest.cc
cc/trees/layer_tree_impl.cc
cc/trees/layer_tree_impl.h