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