Chromium Code Reviews| 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_EVICTION_TILE_PRIORITY_QUEUE_H_ | |
| 6 #define CC_RESOURCES_EVICTION_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 | |
| 15 namespace cc { | |
| 16 | |
| 17 class CC_EXPORT EvictionTilePriorityQueue { | |
| 18 public: | |
| 19 EvictionTilePriorityQueue(); | |
| 20 ~EvictionTilePriorityQueue(); | |
| 21 | |
| 22 void Build(const std::vector<PairedPictureLayer>& paired_layers, | |
| 23 TreePriority tree_priority); | |
| 24 void Reset(); | |
| 25 | |
| 26 void Pop(); | |
| 27 bool IsEmpty() const; | |
| 28 Tile* Top(); | |
| 29 | |
| 30 private: | |
| 31 struct PairedPictureLayerQueue { | |
| 32 PairedPictureLayerQueue(); | |
| 33 ~PairedPictureLayerQueue(); | |
| 34 | |
| 35 Tile* PeekTile(TreePriority tree_priority); | |
| 36 void PopTile(TreePriority tree_priority); | |
|
reveman
2014/07/18 21:08:05
Pop/Top above but PeekTile/PopTile here. Is there
vmpstr
2014/07/18 23:18:13
I've changed the name and added IsEmpty
| |
| 37 | |
| 38 PictureLayerImpl::LayerEvictionTileIterator* NextTileIterator( | |
| 39 TreePriority tree_priority); | |
| 40 | |
| 41 PictureLayerImpl::LayerEvictionTileIterator active_iterator; | |
| 42 PictureLayerImpl::LayerEvictionTileIterator pending_iterator; | |
| 43 | |
| 44 std::vector<Tile*> returned_shared_tiles; | |
|
reveman
2014/07/18 21:08:05
Can you add a TODO here about possibly removing th
vmpstr
2014/07/18 23:18:13
Done.
| |
| 45 }; | |
| 46 | |
| 47 class EvictionOrderComparator { | |
| 48 public: | |
| 49 explicit EvictionOrderComparator(TreePriority tree_priority); | |
| 50 | |
| 51 bool operator()(PairedPictureLayerQueue* a, | |
| 52 PairedPictureLayerQueue* b) const; | |
| 53 | |
| 54 private: | |
| 55 TreePriority tree_priority_; | |
| 56 }; | |
|
reveman
2014/07/18 21:08:05
You can move this to .cc after removing |comparato
vmpstr
2014/07/18 23:18:13
Done.
| |
| 57 | |
| 58 std::vector<PairedPictureLayerQueue> paired_queues_; | |
| 59 std::vector<PairedPictureLayerQueue*> queue_heap_; | |
|
reveman
2014/07/18 21:08:05
I understand that this might be needed for good pe
vmpstr
2014/07/18 23:18:13
Done.
| |
| 60 TreePriority tree_priority_; | |
| 61 EvictionOrderComparator comparator_; | |
|
reveman
2014/07/18 21:08:05
Not obvious to me that caching this comparator is
vmpstr
2014/07/18 23:18:13
Done.
| |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(EvictionTilePriorityQueue); | |
| 64 }; | |
| 65 | |
| 66 } // namespace cc | |
| 67 | |
| 68 #endif // CC_RESOURCES_EVICTION_TILE_PRIORITY_QUEUE_H_ | |
| OLD | NEW |