OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 Tile* current_tile_; | 102 Tile* current_tile_; |
103 TilingData::Iterator visible_iterator_; | 103 TilingData::Iterator visible_iterator_; |
104 TilingData::SpiralDifferenceIterator spiral_iterator_; | 104 TilingData::SpiralDifferenceIterator spiral_iterator_; |
105 }; | 105 }; |
106 | 106 |
107 class CC_EXPORT TilingEvictionTileIterator { | 107 class CC_EXPORT TilingEvictionTileIterator { |
108 public: | 108 public: |
109 TilingEvictionTileIterator(); | 109 TilingEvictionTileIterator(); |
110 TilingEvictionTileIterator(PictureLayerTiling* tiling, | 110 TilingEvictionTileIterator(PictureLayerTiling* tiling, |
111 TreePriority tree_priority); | 111 TreePriority tree_priority, |
| 112 TilePriority::PriorityBin type, |
| 113 bool required_for_activation); |
112 ~TilingEvictionTileIterator(); | 114 ~TilingEvictionTileIterator(); |
113 | 115 |
114 operator bool() const; | 116 operator bool() const; |
115 const Tile* operator*() const; | 117 const Tile* operator*() const; |
116 Tile* operator*(); | 118 Tile* operator*(); |
117 TilingEvictionTileIterator& operator++(); | 119 TilingEvictionTileIterator& operator++(); |
118 TilePriority::PriorityBin get_type() { | |
119 DCHECK(*this); | |
120 const TilePriority& priority = | |
121 (*tile_iterator_)->priority_for_tree_priority(tree_priority_); | |
122 return priority.priority_bin; | |
123 } | |
124 | 120 |
125 private: | 121 private: |
126 PictureLayerTiling* tiling_; | 122 PictureLayerTiling* tiling_; |
127 TreePriority tree_priority_; | 123 TreePriority tree_priority_; |
128 std::vector<Tile*>::iterator tile_iterator_; | 124 std::vector<Tile*>::iterator tile_iterator_; |
| 125 std::vector<Tile*>* eviction_tiles_; |
129 }; | 126 }; |
130 | 127 |
131 ~PictureLayerTiling(); | 128 ~PictureLayerTiling(); |
132 | 129 |
133 // Create a tiling with no tiles. CreateTiles must be called to add some. | 130 // Create a tiling with no tiles. CreateTiles must be called to add some. |
134 static scoped_ptr<PictureLayerTiling> Create( | 131 static scoped_ptr<PictureLayerTiling> Create( |
135 float contents_scale, | 132 float contents_scale, |
136 const gfx::Size& layer_bounds, | 133 const gfx::Size& layer_bounds, |
137 PictureLayerTilingClient* client); | 134 PictureLayerTilingClient* client); |
138 gfx::Size layer_bounds() const { return layer_bounds_; } | 135 gfx::Size layer_bounds() const { return layer_bounds_; } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 gfx::Rect current_visible_rect_; | 316 gfx::Rect current_visible_rect_; |
320 gfx::Rect current_skewport_rect_; | 317 gfx::Rect current_skewport_rect_; |
321 gfx::Rect current_soon_border_rect_; | 318 gfx::Rect current_soon_border_rect_; |
322 gfx::Rect current_eventually_rect_; | 319 gfx::Rect current_eventually_rect_; |
323 | 320 |
324 bool has_visible_rect_tiles_; | 321 bool has_visible_rect_tiles_; |
325 bool has_skewport_rect_tiles_; | 322 bool has_skewport_rect_tiles_; |
326 bool has_soon_border_rect_tiles_; | 323 bool has_soon_border_rect_tiles_; |
327 bool has_eventually_rect_tiles_; | 324 bool has_eventually_rect_tiles_; |
328 | 325 |
329 std::vector<Tile*> eviction_tiles_cache_; | 326 std::vector<Tile*> eventually_eviction_tiles_; |
| 327 std::vector<Tile*> soon_eviction_tiles_; |
| 328 std::vector<Tile*> now_required_for_activation_eviction_tiles_; |
| 329 std::vector<Tile*> now_not_required_for_activation_eviction_tiles_; |
330 bool eviction_tiles_cache_valid_; | 330 bool eviction_tiles_cache_valid_; |
331 TreePriority eviction_cache_tree_priority_; | 331 TreePriority eviction_cache_tree_priority_; |
332 | 332 |
333 private: | 333 private: |
334 DISALLOW_ASSIGN(PictureLayerTiling); | 334 DISALLOW_ASSIGN(PictureLayerTiling); |
335 | 335 |
336 RectExpansionCache expansion_cache_; | 336 RectExpansionCache expansion_cache_; |
337 }; | 337 }; |
338 | 338 |
339 } // namespace cc | 339 } // namespace cc |
340 | 340 |
341 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 341 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |