OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/tiles/eviction_tile_priority_queue.h" | 5 #include "cc/tiles/eviction_tile_priority_queue.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 TreePriority tree_priority_; | 64 TreePriority tree_priority_; |
65 }; | 65 }; |
66 | 66 |
67 void CreateTilingSetEvictionQueues( | 67 void CreateTilingSetEvictionQueues( |
68 const std::vector<PictureLayerImpl*>& layers, | 68 const std::vector<PictureLayerImpl*>& layers, |
69 TreePriority tree_priority, | 69 TreePriority tree_priority, |
70 std::vector<std::unique_ptr<TilingSetEvictionQueue>>* queues) { | 70 std::vector<std::unique_ptr<TilingSetEvictionQueue>>* queues) { |
71 DCHECK(queues->empty()); | 71 DCHECK(queues->empty()); |
72 | 72 |
73 for (auto* layer : layers) { | 73 for (auto* layer : layers) { |
74 std::unique_ptr<TilingSetEvictionQueue> tiling_set_queue = base::WrapUnique( | 74 std::unique_ptr<TilingSetEvictionQueue> tiling_set_queue = |
75 new TilingSetEvictionQueue(layer->picture_layer_tiling_set())); | 75 base::MakeUnique<TilingSetEvictionQueue>( |
| 76 layer->picture_layer_tiling_set()); |
76 // Queues will only contain non empty tiling sets. | 77 // Queues will only contain non empty tiling sets. |
77 if (!tiling_set_queue->IsEmpty()) | 78 if (!tiling_set_queue->IsEmpty()) |
78 queues->push_back(std::move(tiling_set_queue)); | 79 queues->push_back(std::move(tiling_set_queue)); |
79 } | 80 } |
80 std::make_heap(queues->begin(), queues->end(), | 81 std::make_heap(queues->begin(), queues->end(), |
81 EvictionOrderComparator(tree_priority)); | 82 EvictionOrderComparator(tree_priority)); |
82 } | 83 } |
83 | 84 |
84 } // namespace | 85 } // namespace |
85 | 86 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 : active_queues_; | 163 : active_queues_; |
163 } | 164 } |
164 | 165 |
165 // Return tile with a lower priority. | 166 // Return tile with a lower priority. |
166 if (pending_priority.IsHigherPriorityThan(active_priority)) | 167 if (pending_priority.IsHigherPriorityThan(active_priority)) |
167 return active_queues_; | 168 return active_queues_; |
168 return pending_queues_; | 169 return pending_queues_; |
169 } | 170 } |
170 | 171 |
171 } // namespace cc | 172 } // namespace cc |
OLD | NEW |