Chromium Code Reviews| Index: cc/trees/layer_tree_impl.cc |
| diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
| index 583d94219d1d9c2a3bd6ca8a5825fc861d3a7ed9..2b8f993a8966327f83c226777cbfba1c293e3f81 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -1031,6 +1031,11 @@ void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const { |
| for (auto* swap_promise : swap_promise_list_) |
| state->AppendDouble(swap_promise->TraceId()); |
| state->EndArray(); |
| + |
| + state->BeginArray("active_tree_swap_promise_trace_ids"); |
| + for (auto* swap_promise : active_tree_swap_promise_list_) |
| + state->AppendDouble(swap_promise->TraceId()); |
| + state->EndArray(); |
| } |
| void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
| @@ -1108,23 +1113,34 @@ void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |
| swap_promise_list_.push_back(swap_promise.Pass()); |
| } |
| +void LayerTreeImpl::QueueActiveTreeSwapPromise( |
| + scoped_ptr<SwapPromise> swap_promise) { |
| + DCHECK(swap_promise); |
| + active_tree_swap_promise_list_.push_back(swap_promise.Pass()); |
| +} |
| + |
| void LayerTreeImpl::PassSwapPromises( |
| ScopedPtrVector<SwapPromise>* new_swap_promise) { |
| - swap_promise_list_.insert_and_take(swap_promise_list_.end(), |
| - new_swap_promise); |
| - new_swap_promise->clear(); |
| + BreakSwapPromises(SwapPromise::SWAP_FAILS); |
|
danakj
2015/08/14 17:47:39
add a comment explaining what's going on? doesn't
Tobias Sargeant
2015/08/18 11:22:15
Yes, you're right. Corrected now.
|
| + swap_promise_list_.swap(*new_swap_promise); |
| } |
| void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { |
| for (auto* swap_promise : swap_promise_list_) |
| swap_promise->DidSwap(metadata); |
| swap_promise_list_.clear(); |
| + for (auto* swap_promise : active_tree_swap_promise_list_) |
| + swap_promise->DidSwap(metadata); |
| + active_tree_swap_promise_list_.clear(); |
| } |
| void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| for (auto* swap_promise : swap_promise_list_) |
| swap_promise->DidNotSwap(reason); |
| swap_promise_list_.clear(); |
| + for (auto* swap_promise : active_tree_swap_promise_list_) |
| + swap_promise->DidNotSwap(reason); |
| + active_tree_swap_promise_list_.clear(); |
| } |
| void LayerTreeImpl::DidModifyTilePriorities() { |