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 ff5da70a7e7ec633092d56de8cc7282b1316b21e..975e82e4d4edfdeaddd244af4c8bb1fb63dd7afd 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -8,6 +8,7 @@ |
| #include <stdint.h> |
| #include <algorithm> |
| +#include <iterator> |
| #include <limits> |
| #include <set> |
| @@ -424,7 +425,7 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
| next_activation_forces_redraw_ = false; |
| } |
| - target_tree->PassSwapPromises(&swap_promise_list_); |
| + target_tree->PassSwapPromises(std::move(swap_promise_list_)); |
| target_tree->set_top_controls_shrink_blink_size( |
| top_controls_shrink_blink_size_); |
| @@ -1483,11 +1484,18 @@ void LayerTreeImpl::QueuePinnedSwapPromise( |
| } |
| void LayerTreeImpl::PassSwapPromises( |
| - std::vector<std::unique_ptr<SwapPromise>>* new_swap_promise) { |
| + std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) { |
| for (const auto& swap_promise : swap_promise_list_) |
| swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS); |
| swap_promise_list_.clear(); |
| - swap_promise_list_.swap(*new_swap_promise); |
| + swap_promise_list_.swap(new_swap_promises); |
| +} |
| + |
| +void LayerTreeImpl::AppendSwapPromises( |
| + std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) { |
| + std::move(new_swap_promises.begin(), new_swap_promises.end(), |
| + std::back_inserter(swap_promise_list_)); |
| + new_swap_promises.clear(); |
|
brianderson
2016/07/28 18:10:53
Is this call to clear needed?
sunnyps
2016/08/02 02:55:09
I believe so because we're moving the individual u
|
| } |
| void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { |