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 <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 PictureLayerTiling* tiling_; | 112 PictureLayerTiling* tiling_; |
113 | 113 |
114 Phase phase_; | 114 Phase phase_; |
115 | 115 |
116 Tile* current_tile_; | 116 Tile* current_tile_; |
117 TilingData::Iterator visible_iterator_; | 117 TilingData::Iterator visible_iterator_; |
118 TilingData::SpiralDifferenceIterator spiral_iterator_; | 118 TilingData::SpiralDifferenceIterator spiral_iterator_; |
119 }; | 119 }; |
120 | 120 |
121 class CC_EXPORT TilingEvictionTileIterator { | |
122 public: | |
123 TilingEvictionTileIterator(); | |
124 TilingEvictionTileIterator(PictureLayerTiling* tiling, | |
125 TreePriority tree_priority, | |
126 EvictionCategory category); | |
127 ~TilingEvictionTileIterator(); | |
128 | |
129 operator bool() const; | |
130 const Tile* operator*() const; | |
131 Tile* operator*(); | |
132 TilingEvictionTileIterator& operator++(); | |
133 | |
134 private: | |
135 const std::vector<Tile*>* eviction_tiles_; | |
136 size_t current_eviction_tiles_index_; | |
137 }; | |
138 | |
139 ~PictureLayerTiling(); | 121 ~PictureLayerTiling(); |
140 | 122 |
141 // Create a tiling with no tiles. CreateTiles must be called to add some. | 123 // Create a tiling with no tiles. CreateTiles must be called to add some. |
142 static scoped_ptr<PictureLayerTiling> Create( | 124 static scoped_ptr<PictureLayerTiling> Create( |
143 float contents_scale, | 125 float contents_scale, |
144 const gfx::Size& layer_bounds, | 126 const gfx::Size& layer_bounds, |
145 PictureLayerTilingClient* client); | 127 PictureLayerTilingClient* client); |
146 gfx::Size layer_bounds() const { return layer_bounds_; } | 128 gfx::Size layer_bounds() const { return layer_bounds_; } |
147 void UpdateTilesToCurrentRasterSource(RasterSource* raster_source, | 129 void UpdateTilesToCurrentRasterSource(RasterSource* raster_source, |
148 const Region& layer_invalidation, | 130 const Region& layer_invalidation, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 const gfx::Rect& bounding_rect, | 274 const gfx::Rect& bounding_rect, |
293 RectExpansionCache* cache); | 275 RectExpansionCache* cache); |
294 | 276 |
295 bool has_ever_been_updated() const { | 277 bool has_ever_been_updated() const { |
296 return last_impl_frame_time_in_seconds_ != 0.0; | 278 return last_impl_frame_time_in_seconds_ != 0.0; |
297 } | 279 } |
298 | 280 |
299 protected: | 281 protected: |
300 friend class CoverageIterator; | 282 friend class CoverageIterator; |
301 friend class TilingRasterTileIterator; | 283 friend class TilingRasterTileIterator; |
302 friend class TilingEvictionTileIterator; | 284 friend class TilingSetEvictionQueue; |
303 | 285 |
304 typedef std::pair<int, int> TileMapKey; | 286 typedef std::pair<int, int> TileMapKey; |
305 typedef base::hash_map<TileMapKey, scoped_refptr<Tile>> TileMap; | 287 typedef base::hash_map<TileMapKey, scoped_refptr<Tile>> TileMap; |
306 | 288 |
307 PictureLayerTiling(float contents_scale, | 289 PictureLayerTiling(float contents_scale, |
308 const gfx::Size& layer_bounds, | 290 const gfx::Size& layer_bounds, |
309 PictureLayerTilingClient* client); | 291 PictureLayerTilingClient* client); |
310 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); | 292 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); |
311 void VerifyLiveTilesRect(); | 293 void VerifyLiveTilesRect(); |
312 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); | 294 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 362 |
381 private: | 363 private: |
382 DISALLOW_ASSIGN(PictureLayerTiling); | 364 DISALLOW_ASSIGN(PictureLayerTiling); |
383 | 365 |
384 RectExpansionCache expansion_cache_; | 366 RectExpansionCache expansion_cache_; |
385 }; | 367 }; |
386 | 368 |
387 } // namespace cc | 369 } // namespace cc |
388 | 370 |
389 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 371 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |