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_RASTER_QUEUE_H_ | 5 #ifndef CC_RESOURCES_TILING_SET_RASTER_QUEUE_ALL_H_ |
6 #define CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_ | 6 #define CC_RESOURCES_TILING_SET_RASTER_QUEUE_ALL_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/resources/picture_layer_tiling_set.h" | 9 #include "cc/resources/picture_layer_tiling_set.h" |
10 #include "cc/resources/tile.h" | 10 #include "cc/resources/tile.h" |
11 #include "cc/resources/tile_priority.h" | 11 #include "cc/resources/tile_priority.h" |
| 12 #include "cc/resources/tiling_set_raster_queue.h" |
12 | 13 |
13 namespace cc { | 14 namespace cc { |
14 | 15 |
15 class CC_EXPORT TilingSetRasterQueue { | 16 // This queue returns all tiles required to be rasterized from HIGH_RESOLUTION |
| 17 // and LOW_RESOLUTION tilings. |
| 18 class CC_EXPORT TilingSetRasterQueueAll |
| 19 : public NON_EXPORTED_BASE(TilingSetRasterQueue) { |
16 public: | 20 public: |
17 TilingSetRasterQueue(); | 21 TilingSetRasterQueueAll(PictureLayerTilingSet* tiling_set, |
18 TilingSetRasterQueue(PictureLayerTilingSet* tiling_set, | 22 bool prioritize_low_res); |
19 bool prioritize_low_res); | 23 ~TilingSetRasterQueueAll() override; |
20 ~TilingSetRasterQueue(); | |
21 | 24 |
22 Tile* Top(); | 25 Tile* Top() override; |
23 const Tile* Top() const; | 26 const Tile* Top() const override; |
24 void Pop(); | 27 void Pop() override; |
25 bool IsEmpty() const; | 28 bool IsEmpty() const override; |
26 | 29 |
27 private: | 30 private: |
28 class TilingIterator { | 31 class TilingIterator { |
29 public: | 32 public: |
30 TilingIterator(); | 33 TilingIterator(); |
31 explicit TilingIterator(PictureLayerTiling* tiling, | 34 explicit TilingIterator(PictureLayerTiling* tiling, |
32 TilingData* tiling_data); | 35 TilingData* tiling_data); |
33 ~TilingIterator(); | 36 ~TilingIterator(); |
34 | 37 |
35 operator bool() const { return !!current_tile_; } | 38 bool done() const { return current_tile_ == nullptr; } |
36 const Tile* operator*() const { return current_tile_; } | 39 const Tile* operator*() const { return current_tile_; } |
37 Tile* operator*() { return current_tile_; } | 40 Tile* operator*() { return current_tile_; } |
38 TilePriority::PriorityBin type() const { | 41 TilePriority::PriorityBin type() const { |
39 switch (phase_) { | 42 switch (phase_) { |
40 case VISIBLE_RECT: | 43 case VISIBLE_RECT: |
41 return TilePriority::NOW; | 44 return TilePriority::NOW; |
42 case SKEWPORT_RECT: | 45 case SKEWPORT_RECT: |
43 case SOON_BORDER_RECT: | 46 case SOON_BORDER_RECT: |
44 return TilePriority::SOON; | 47 return TilePriority::SOON; |
45 case EVENTUALLY_RECT: | 48 case EVENTUALLY_RECT: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 90 |
88 size_t current_stage_; | 91 size_t current_stage_; |
89 | 92 |
90 // One low res stage, and three high res stages. | 93 // One low res stage, and three high res stages. |
91 IterationStage stages_[4]; | 94 IterationStage stages_[4]; |
92 TilingIterator iterators_[NUM_ITERATORS]; | 95 TilingIterator iterators_[NUM_ITERATORS]; |
93 }; | 96 }; |
94 | 97 |
95 } // namespace cc | 98 } // namespace cc |
96 | 99 |
97 #endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_ | 100 #endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_ALL_H_ |
OLD | NEW |