diff options
author | tobiasjs <tobiasjs@chromium.org> | 2015-09-02 05:08:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-02 12:08:37 +0000 |
commit | 2e02f73e17f4fc3f611a08582b7944bb32362a2f (patch) | |
tree | 3ec8063fc9f44fe20b1e77343d14503d45242344 /cc/trees/latency_info_swap_promise_monitor.cc | |
parent | 5bb9337f661b52f6298d59c1aba5cc100677dd0b (diff) | |
download | chromium_src-2e02f73e17f4fc3f611a08582b7944bb32362a2f.zip chromium_src-2e02f73e17f4fc3f611a08582b7944bb32362a2f.tar.gz chromium_src-2e02f73e17f4fc3f611a08582b7944bb32362a2f.tar.bz2 |
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}
Diffstat (limited to 'cc/trees/latency_info_swap_promise_monitor.cc')
-rw-r--r-- | cc/trees/latency_info_swap_promise_monitor.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cc/trees/latency_info_swap_promise_monitor.cc b/cc/trees/latency_info_swap_promise_monitor.cc index 6e9c57e..a57ae4c 100644 --- a/cc/trees/latency_info_swap_promise_monitor.cc +++ b/cc/trees/latency_info_swap_promise_monitor.cc @@ -59,7 +59,12 @@ void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { void LatencyInfoSwapPromiseMonitor::OnSetNeedsRedrawOnImpl() { if (AddRenderingScheduledComponent(latency_, false /* on_main */)) { scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_)); - layer_tree_host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass()); + // Queue a pinned swap promise on the active tree. This will allow + // measurement of the time to the next SwapBuffers(). The swap + // promise is pinned so that it is not interrupted by new incoming + // activations (which would otherwise break the swap promise). + layer_tree_host_impl_->active_tree()->QueuePinnedSwapPromise( + swap_promise.Pass()); } } |