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 #ifndef CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ | 5 #ifndef CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ |
6 #define CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ | 6 #define CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 }; | 86 }; |
87 | 87 |
88 void GenerateTilingOrder(PictureLayerTilingSet* tiling_set); | 88 void GenerateTilingOrder(PictureLayerTilingSet* tiling_set); |
89 | 89 |
90 // Helper base class for individual region iterators. | 90 // Helper base class for individual region iterators. |
91 class EvictionRectIterator { | 91 class EvictionRectIterator { |
92 public: | 92 public: |
93 EvictionRectIterator(); | 93 EvictionRectIterator(); |
94 EvictionRectIterator(std::vector<PictureLayerTiling*>* tilings, | 94 EvictionRectIterator(std::vector<PictureLayerTiling*>* tilings, |
95 WhichTree tree, | 95 WhichTree tree, |
96 bool skip_pending_visible_rect); | 96 PictureLayerTiling::PriorityRect priority_rect); |
97 | 97 |
98 bool done() const { return !tile_; } | 98 bool done() const { return !tile_; } |
99 Tile* operator*() const { return tile_; } | 99 Tile* operator*() const { return tile_; } |
100 | 100 |
101 protected: | 101 protected: |
102 ~EvictionRectIterator() = default; | 102 ~EvictionRectIterator() = default; |
103 | 103 |
104 template <typename TilingIteratorType> | 104 template <typename TilingIteratorType> |
105 bool AdvanceToNextTile(TilingIteratorType* iterator); | 105 bool AdvanceToNextTile(TilingIteratorType* iterator); |
106 template <typename TilingIteratorType> | 106 template <typename TilingIteratorType> |
107 bool GetFirstTileAndCheckIfValid(TilingIteratorType* iterator); | 107 bool GetFirstTileAndCheckIfValid(TilingIteratorType* iterator); |
108 | 108 |
109 Tile* tile_; | 109 Tile* tile_; |
110 std::vector<PictureLayerTiling*>* tilings_; | 110 std::vector<PictureLayerTiling*>* tilings_; |
111 WhichTree tree_; | 111 WhichTree tree_; |
112 bool skip_pending_visible_rect_; | 112 PictureLayerTiling::PriorityRect priority_rect_; |
113 size_t tiling_index_; | 113 size_t tiling_index_; |
114 }; | 114 }; |
115 | 115 |
116 class PendingVisibleTilingIterator : public EvictionRectIterator { | 116 class PendingVisibleTilingIterator : public EvictionRectIterator { |
117 public: | 117 public: |
118 PendingVisibleTilingIterator() = default; | 118 PendingVisibleTilingIterator() = default; |
119 PendingVisibleTilingIterator(std::vector<PictureLayerTiling*>* tilings, | 119 PendingVisibleTilingIterator(std::vector<PictureLayerTiling*>* tilings, |
120 WhichTree tree, | 120 WhichTree tree, |
121 bool return_required_for_activation_tiles); | 121 bool return_required_for_activation_tiles); |
122 | 122 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 EventuallyTilingIterator eventually_iterator_; | 193 EventuallyTilingIterator eventually_iterator_; |
194 SoonBorderTilingIterator soon_iterator_; | 194 SoonBorderTilingIterator soon_iterator_; |
195 SkewportTilingIterator skewport_iterator_; | 195 SkewportTilingIterator skewport_iterator_; |
196 PendingVisibleTilingIterator pending_visible_iterator_; | 196 PendingVisibleTilingIterator pending_visible_iterator_; |
197 VisibleTilingIterator visible_iterator_; | 197 VisibleTilingIterator visible_iterator_; |
198 }; | 198 }; |
199 | 199 |
200 } // namespace cc | 200 } // namespace cc |
201 | 201 |
202 #endif // CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ | 202 #endif // CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ |
OLD | NEW |