OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/raster_tile_priority_queue_all.h" | 5 #include "cc/tiles/raster_tile_priority_queue_all.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "cc/tiles/tiling_set_raster_queue_all.h" | 8 #include "cc/tiles/tiling_set_raster_queue_all.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 std::vector<std::unique_ptr<TilingSetRasterQueueAll>>* queues) { | 56 std::vector<std::unique_ptr<TilingSetRasterQueueAll>>* queues) { |
57 DCHECK(queues->empty()); | 57 DCHECK(queues->empty()); |
58 | 58 |
59 for (auto* layer : layers) { | 59 for (auto* layer : layers) { |
60 if (!layer->HasValidTilePriorities()) | 60 if (!layer->HasValidTilePriorities()) |
61 continue; | 61 continue; |
62 | 62 |
63 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set(); | 63 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set(); |
64 bool prioritize_low_res = tree_priority == SMOOTHNESS_TAKES_PRIORITY; | 64 bool prioritize_low_res = tree_priority == SMOOTHNESS_TAKES_PRIORITY; |
65 std::unique_ptr<TilingSetRasterQueueAll> tiling_set_queue = | 65 std::unique_ptr<TilingSetRasterQueueAll> tiling_set_queue = |
66 base::WrapUnique( | 66 base::MakeUnique<TilingSetRasterQueueAll>(tiling_set, |
67 new TilingSetRasterQueueAll(tiling_set, prioritize_low_res)); | 67 prioritize_low_res); |
68 // Queues will only contain non empty tiling sets. | 68 // Queues will only contain non empty tiling sets. |
69 if (!tiling_set_queue->IsEmpty()) | 69 if (!tiling_set_queue->IsEmpty()) |
70 queues->push_back(std::move(tiling_set_queue)); | 70 queues->push_back(std::move(tiling_set_queue)); |
71 } | 71 } |
72 std::make_heap(queues->begin(), queues->end(), | 72 std::make_heap(queues->begin(), queues->end(), |
73 RasterOrderComparator(tree_priority)); | 73 RasterOrderComparator(tree_priority)); |
74 } | 74 } |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 | 77 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return active_queues_; | 171 return active_queues_; |
172 return pending_queues_; | 172 return pending_queues_; |
173 } | 173 } |
174 default: | 174 default: |
175 NOTREACHED(); | 175 NOTREACHED(); |
176 return active_queues_; | 176 return active_queues_; |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace cc | 180 } // namespace cc |
OLD | NEW |