OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 | 1508 |
1509 void LayerTreeImpl::AppendSwapPromises( | 1509 void LayerTreeImpl::AppendSwapPromises( |
1510 std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) { | 1510 std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) { |
1511 std::move(new_swap_promises.begin(), new_swap_promises.end(), | 1511 std::move(new_swap_promises.begin(), new_swap_promises.end(), |
1512 std::back_inserter(swap_promise_list_)); | 1512 std::back_inserter(swap_promise_list_)); |
1513 new_swap_promises.clear(); | 1513 new_swap_promises.clear(); |
1514 } | 1514 } |
1515 | 1515 |
1516 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { | 1516 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { |
1517 for (const auto& swap_promise : swap_promise_list_) | 1517 for (const auto& swap_promise : swap_promise_list_) |
1518 swap_promise->DidSwap(metadata); | 1518 swap_promise->WillSwap(metadata); |
| 1519 for (const auto& swap_promise : pinned_swap_promise_list_) |
| 1520 swap_promise->WillSwap(metadata); |
| 1521 } |
| 1522 |
| 1523 void LayerTreeImpl::ClearSwapPromises() { |
| 1524 for (const auto& swap_promise : swap_promise_list_) |
| 1525 swap_promise->DidSwap(); |
1519 swap_promise_list_.clear(); | 1526 swap_promise_list_.clear(); |
1520 for (const auto& swap_promise : pinned_swap_promise_list_) | 1527 for (const auto& swap_promise : pinned_swap_promise_list_) |
1521 swap_promise->DidSwap(metadata); | 1528 swap_promise->DidSwap(); |
1522 pinned_swap_promise_list_.clear(); | 1529 pinned_swap_promise_list_.clear(); |
1523 } | 1530 } |
1524 | 1531 |
1525 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1532 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1526 { | 1533 { |
1527 std::vector<std::unique_ptr<SwapPromise>> persistent_swap_promises; | 1534 std::vector<std::unique_ptr<SwapPromise>> persistent_swap_promises; |
1528 for (auto& swap_promise : swap_promise_list_) { | 1535 for (auto& swap_promise : swap_promise_list_) { |
1529 if (swap_promise->DidNotSwap(reason) == | 1536 if (swap_promise->DidNotSwap(reason) == |
1530 SwapPromise::DidNotSwapAction::KEEP_ACTIVE) { | 1537 SwapPromise::DidNotSwapAction::KEEP_ACTIVE) { |
1531 persistent_swap_promises.push_back(std::move(swap_promise)); | 1538 persistent_swap_promises.push_back(std::move(swap_promise)); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 | 2079 |
2073 void LayerTreeImpl::ResetAllChangeTracking() { | 2080 void LayerTreeImpl::ResetAllChangeTracking() { |
2074 layers_that_should_push_properties_.clear(); | 2081 layers_that_should_push_properties_.clear(); |
2075 // Iterate over all layers, including masks. | 2082 // Iterate over all layers, including masks. |
2076 for (auto& layer : *layers_) | 2083 for (auto& layer : *layers_) |
2077 layer->ResetChangeTracking(); | 2084 layer->ResetChangeTracking(); |
2078 property_trees_.ResetAllChangeTracking(); | 2085 property_trees_.ResetAllChangeTracking(); |
2079 } | 2086 } |
2080 | 2087 |
2081 } // namespace cc | 2088 } // namespace cc |
OLD | NEW |