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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_OCCLUDED, | 84 VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_OCCLUDED, |
85 VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_UNOCCLUDED | 85 VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_UNOCCLUDED |
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( |
95 WhichTree tree, | 95 std::vector<PictureLayerTiling*>* tilings, |
96 bool skip_pending_visible_rect); | 96 WhichTree tree, |
| 97 PictureLayerTiling::PriorityRectType priority_rect_type); |
97 | 98 |
98 bool done() const { return !prioritized_tile_.tile(); } | 99 bool done() const { return !prioritized_tile_.tile(); } |
99 const PrioritizedTile& operator*() const { return prioritized_tile_; } | 100 const PrioritizedTile& operator*() const { return prioritized_tile_; } |
100 | 101 |
101 protected: | 102 protected: |
102 ~EvictionRectIterator() = default; | 103 ~EvictionRectIterator() = default; |
103 | 104 |
104 template <typename TilingIteratorType> | 105 template <typename TilingIteratorType> |
105 bool AdvanceToNextTile(TilingIteratorType* iterator); | 106 bool AdvanceToNextTile(TilingIteratorType* iterator); |
106 template <typename TilingIteratorType> | 107 template <typename TilingIteratorType> |
107 bool GetFirstTileAndCheckIfValid(TilingIteratorType* iterator); | 108 bool GetFirstTileAndCheckIfValid(TilingIteratorType* iterator); |
108 | 109 |
109 PrioritizedTile prioritized_tile_; | 110 PrioritizedTile prioritized_tile_; |
110 std::vector<PictureLayerTiling*>* tilings_; | 111 std::vector<PictureLayerTiling*>* tilings_; |
111 WhichTree tree_; | 112 WhichTree tree_; |
112 bool skip_pending_visible_rect_; | 113 PictureLayerTiling::PriorityRectType priority_rect_type_; |
113 size_t tiling_index_; | 114 size_t tiling_index_; |
114 }; | 115 }; |
115 | 116 |
116 class PendingVisibleTilingIterator : public EvictionRectIterator { | 117 class PendingVisibleTilingIterator : public EvictionRectIterator { |
117 public: | 118 public: |
118 PendingVisibleTilingIterator() = default; | 119 PendingVisibleTilingIterator() = default; |
119 PendingVisibleTilingIterator(std::vector<PictureLayerTiling*>* tilings, | 120 PendingVisibleTilingIterator(std::vector<PictureLayerTiling*>* tilings, |
120 WhichTree tree, | 121 WhichTree tree, |
121 bool return_required_for_activation_tiles); | 122 bool return_required_for_activation_tiles); |
122 | 123 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 EventuallyTilingIterator eventually_iterator_; | 194 EventuallyTilingIterator eventually_iterator_; |
194 SoonBorderTilingIterator soon_iterator_; | 195 SoonBorderTilingIterator soon_iterator_; |
195 SkewportTilingIterator skewport_iterator_; | 196 SkewportTilingIterator skewport_iterator_; |
196 PendingVisibleTilingIterator pending_visible_iterator_; | 197 PendingVisibleTilingIterator pending_visible_iterator_; |
197 VisibleTilingIterator visible_iterator_; | 198 VisibleTilingIterator visible_iterator_; |
198 }; | 199 }; |
199 | 200 |
200 } // namespace cc | 201 } // namespace cc |
201 | 202 |
202 #endif // CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ | 203 #endif // CC_RESOURCES_TILING_SET_EVICTION_QUEUE_H_ |
OLD | NEW |