OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ |
| 6 #define CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ |
| 7 |
| 8 #include <utility> |
| 9 #include <vector> |
| 10 |
| 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/layers/picture_layer_impl.h" |
| 13 #include "cc/resources/tile_priority.h" |
| 14 #include "cc/resources/tile_priority_queue.h" |
| 15 |
| 16 namespace cc { |
| 17 |
| 18 class CC_EXPORT RasterTilePriorityQueue : public TilePriorityQueue { |
| 19 public: |
| 20 RasterTilePriorityQueue(); |
| 21 virtual ~RasterTilePriorityQueue(); |
| 22 |
| 23 void Prepare(const std::vector<PairedPictureLayer>& paired_picture_layers, |
| 24 TreePriority tree_priority); |
| 25 |
| 26 // TilePriorityQueue overrides. |
| 27 virtual void Pop() OVERRIDE; |
| 28 virtual bool IsEmpty() OVERRIDE; |
| 29 virtual Tile* Top() OVERRIDE; |
| 30 |
| 31 private: |
| 32 struct PairedPictureLayerIterator { |
| 33 PairedPictureLayerIterator(); |
| 34 ~PairedPictureLayerIterator(); |
| 35 |
| 36 Tile* PeekTile(TreePriority tree_priority); |
| 37 void PopTile(TreePriority tree_priority); |
| 38 |
| 39 std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree> |
| 40 NextTileIterator(TreePriority tree_priority); |
| 41 |
| 42 PictureLayerImpl::LayerRasterTileIterator active_iterator; |
| 43 PictureLayerImpl::LayerRasterTileIterator pending_iterator; |
| 44 |
| 45 std::vector<Tile*> returned_shared_tiles; |
| 46 }; |
| 47 |
| 48 class RasterOrderComparator { |
| 49 public: |
| 50 explicit RasterOrderComparator(TreePriority tree_priority); |
| 51 |
| 52 bool operator()(PairedPictureLayerIterator* a, |
| 53 PairedPictureLayerIterator* b) const; |
| 54 |
| 55 private: |
| 56 TreePriority tree_priority_; |
| 57 }; |
| 58 |
| 59 std::vector<PairedPictureLayerIterator> paired_iterators_; |
| 60 std::vector<PairedPictureLayerIterator*> iterator_heap_; |
| 61 TreePriority tree_priority_; |
| 62 RasterOrderComparator comparator_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(RasterTilePriorityQueue); |
| 65 }; |
| 66 |
| 67 } // namespace cc |
| 68 |
| 69 #endif // CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ |
OLD | NEW |