| Index: cc/trees/layer_tree_impl.cc
|
| diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
|
| index ff5da70a7e7ec633092d56de8cc7282b1316b21e..fc017fe239807e85aaa9baa7a87c686cece7ec87 100644
|
| --- a/cc/trees/layer_tree_impl.cc
|
| +++ b/cc/trees/layer_tree_impl.cc
|
| @@ -1483,11 +1483,17 @@ void LayerTreeImpl::QueuePinnedSwapPromise(
|
| }
|
|
|
| void LayerTreeImpl::PassSwapPromises(
|
| - std::vector<std::unique_ptr<SwapPromise>>* new_swap_promise) {
|
| - for (const auto& swap_promise : swap_promise_list_)
|
| - swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS);
|
| + std::vector<std::unique_ptr<SwapPromise>>* new_swap_promises) {
|
| + for (auto& swap_promise : swap_promise_list_) {
|
| + if (swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS) ==
|
| + SwapPromise::DidNotSwapAction::KEEP_ACTIVE) {
|
| + // |swap_promise| must remain active, so place it in |new_swap_promises|
|
| + // in order to keep it alive and active.
|
| + new_swap_promises->push_back(std::move(swap_promise));
|
| + }
|
| + }
|
| swap_promise_list_.clear();
|
| - swap_promise_list_.swap(*new_swap_promise);
|
| + swap_promise_list_.swap(*new_swap_promises);
|
| }
|
|
|
| void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
|
| @@ -1500,12 +1506,30 @@ void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
|
| }
|
|
|
| void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
|
| - for (const auto& swap_promise : swap_promise_list_)
|
| - swap_promise->DidNotSwap(reason);
|
| - swap_promise_list_.clear();
|
| - for (const auto& swap_promise : pinned_swap_promise_list_)
|
| - swap_promise->DidNotSwap(reason);
|
| - pinned_swap_promise_list_.clear();
|
| + {
|
| + std::vector<std::unique_ptr<SwapPromise>> persistent_swap_promises;
|
| + for (auto& swap_promise : swap_promise_list_) {
|
| + if (swap_promise->DidNotSwap(reason) ==
|
| + SwapPromise::DidNotSwapAction::KEEP_ACTIVE) {
|
| + persistent_swap_promises.push_back(std::move(swap_promise));
|
| + }
|
| + }
|
| + // |persistent_swap_promises| must remain active even when swap fails.
|
| + swap_promise_list_ = std::move(persistent_swap_promises);
|
| + }
|
| +
|
| + {
|
| + std::vector<std::unique_ptr<SwapPromise>> persistent_swap_promises;
|
| + for (auto& swap_promise : pinned_swap_promise_list_) {
|
| + if (swap_promise->DidNotSwap(reason) ==
|
| + SwapPromise::DidNotSwapAction::KEEP_ACTIVE) {
|
| + persistent_swap_promises.push_back(std::move(swap_promise));
|
| + }
|
| + }
|
| +
|
| + // |persistent_swap_promises| must remain active even when swap fails.
|
| + pinned_swap_promise_list_ = std::move(persistent_swap_promises);
|
| + }
|
| }
|
|
|
| void LayerTreeImpl::DidModifyTilePriorities() {
|
|
|