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 ff048674af2bae33feb2d5987282c434be177d98..fba8c9b7a889e221101cde99ad1ab9e596c4b486 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -224,6 +224,10 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
| next_activation_forces_redraw_ = false; |
| } |
| + for (auto* swap_promise : pinned_swap_promise_list_) |
|
danakj
2015/08/25 21:37:30
Why is this here and not in DidBecomeActive like f
Tobias Sargeant
2015/08/26 11:06:49
I've added a comment describing why this is here,
danakj
2015/08/26 18:16:16
Is there a use case for pinned swap promises on th
|
| + swap_promise->DidActivate(); |
| + pinned_swap_promise_list_.clear(); |
| + |
| target_tree->PassSwapPromises(&swap_promise_list_); |
| target_tree->set_top_controls_shrink_blink_size( |
| @@ -804,6 +808,7 @@ void LayerTreeImpl::DidBecomeActive() { |
| for (auto* swap_promise : swap_promise_list_) |
| swap_promise->DidActivate(); |
| + |
|
danakj
2015/08/25 21:37:31
please don't add whitespace randomly
|
| devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(), |
| source_frame_number_); |
| } |
| @@ -1031,6 +1036,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("pinned_swap_promise_trace_ids"); |
| + for (auto* swap_promise : pinned_swap_promise_list_) |
| + state->AppendDouble(swap_promise->TraceId()); |
| + state->EndArray(); |
| } |
| void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
| @@ -1108,23 +1118,37 @@ void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |
| swap_promise_list_.push_back(swap_promise.Pass()); |
| } |
| +void LayerTreeImpl::QueuePinnedSwapPromise( |
| + scoped_ptr<SwapPromise> swap_promise) { |
| + DCHECK(swap_promise); |
| + pinned_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(); |
| + for (auto* swap_promise : swap_promise_list_) { |
| + swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS); |
| + } |
| + swap_promise_list_.clear(); |
| + 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 : pinned_swap_promise_list_) |
| + swap_promise->DidSwap(metadata); |
| + pinned_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 : pinned_swap_promise_list_) |
| + swap_promise->DidNotSwap(reason); |
| + pinned_swap_promise_list_.clear(); |
| } |
| void LayerTreeImpl::DidModifyTilePriorities() { |