| 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_TILING_SET_RASTER_QUEUE_REQUIRED_H_ | |
| 6 #define CC_RESOURCES_TILING_SET_RASTER_QUEUE_REQUIRED_H_ | |
| 7 | |
| 8 #include "cc/base/cc_export.h" | |
| 9 #include "cc/resources/picture_layer_tiling_set.h" | |
| 10 #include "cc/resources/raster_tile_priority_queue.h" | |
| 11 #include "cc/resources/tile.h" | |
| 12 | |
| 13 namespace cc { | |
| 14 | |
| 15 // This queue only returns tiles that are required for either activation or | |
| 16 // draw, as specified by RasterTilePriorityQueue::Type passed in the | |
| 17 // constructor. | |
| 18 class CC_EXPORT TilingSetRasterQueueRequired { | |
| 19 public: | |
| 20 TilingSetRasterQueueRequired(PictureLayerTilingSet* tiling_set, | |
| 21 RasterTilePriorityQueue::Type type); | |
| 22 ~TilingSetRasterQueueRequired(); | |
| 23 | |
| 24 const PrioritizedTile& Top() const; | |
| 25 void Pop(); | |
| 26 bool IsEmpty() const; | |
| 27 | |
| 28 private: | |
| 29 // This iterator will return all tiles that are in the NOW bin on the given | |
| 30 // tiling. The queue can then use these tiles and further filter them based on | |
| 31 // whether they are required or not. | |
| 32 class TilingIterator { | |
| 33 public: | |
| 34 TilingIterator(); | |
| 35 explicit TilingIterator(PictureLayerTiling* tiling, | |
| 36 TilingData* tiling_data, | |
| 37 const gfx::Rect& rect); | |
| 38 ~TilingIterator(); | |
| 39 | |
| 40 bool done() const { return !current_tile_.tile(); } | |
| 41 const PrioritizedTile& operator*() const { return current_tile_; } | |
| 42 TilingIterator& operator++(); | |
| 43 | |
| 44 private: | |
| 45 PictureLayerTiling* tiling_; | |
| 46 TilingData* tiling_data_; | |
| 47 | |
| 48 PrioritizedTile current_tile_; | |
| 49 TilingData::Iterator visible_iterator_; | |
| 50 }; | |
| 51 | |
| 52 bool IsTileRequired(const PrioritizedTile& prioritized_tile) const; | |
| 53 | |
| 54 TilingIterator iterator_; | |
| 55 RasterTilePriorityQueue::Type type_; | |
| 56 }; | |
| 57 | |
| 58 } // namespace cc | |
| 59 | |
| 60 #endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_REQUIRED_H_ | |
| OLD | NEW |