Index: cc/resources/tiling_set_raster_queue_all.h |
diff --git a/cc/resources/tiling_set_raster_queue_all.h b/cc/resources/tiling_set_raster_queue_all.h |
index ebca838f232b288c00e6e6770d3d97e997d23bf2..e210f2865e1ccff0cb2a9b159e125d4cd2eaa9f7 100644 |
--- a/cc/resources/tiling_set_raster_queue_all.h |
+++ b/cc/resources/tiling_set_raster_queue_all.h |
@@ -5,6 +5,7 @@ |
#ifndef CC_RESOURCES_TILING_SET_RASTER_QUEUE_ALL_H_ |
#define CC_RESOURCES_TILING_SET_RASTER_QUEUE_ALL_H_ |
+#include "base/containers/stack_container.h" |
#include "cc/base/cc_export.h" |
#include "cc/resources/picture_layer_tiling_set.h" |
#include "cc/resources/tile.h" |
@@ -64,6 +65,18 @@ class CC_EXPORT TilingSetRasterQueueAll { |
TilingData::Iterator iterator_; |
}; |
+ class PendingVisibleTilingIterator : public OnePriorityRectIterator { |
+ public: |
+ PendingVisibleTilingIterator() = default; |
+ PendingVisibleTilingIterator(PictureLayerTiling* tiling, |
+ TilingData* tiling_data); |
+ |
+ PendingVisibleTilingIterator& operator++(); |
+ |
+ private: |
+ TilingData::DifferenceIterator iterator_; |
+ }; |
+ |
// Iterates over skewport only, spiral around the visible rect. |
class SkewportTilingIterator : public OnePriorityRectIterator { |
public: |
@@ -74,6 +87,7 @@ class CC_EXPORT TilingSetRasterQueueAll { |
private: |
TilingData::SpiralDifferenceIterator iterator_; |
+ gfx::Rect pending_visible_rect_; |
}; |
// Iterates over soon border only, spiral around the visible rect. |
@@ -87,6 +101,7 @@ class CC_EXPORT TilingSetRasterQueueAll { |
private: |
TilingData::SpiralDifferenceIterator iterator_; |
+ gfx::Rect pending_visible_rect_; |
}; |
// Iterates over eventually rect only, spiral around the soon rect. |
@@ -100,6 +115,7 @@ class CC_EXPORT TilingSetRasterQueueAll { |
private: |
TilingData::SpiralDifferenceIterator iterator_; |
+ gfx::Rect pending_visible_rect_; |
}; |
// Iterates over all of the above phases in the following order: visible, |
@@ -109,7 +125,7 @@ class CC_EXPORT TilingSetRasterQueueAll { |
TilingIterator(); |
explicit TilingIterator(PictureLayerTiling* tiling, |
TilingData* tiling_data); |
- ~TilingIterator() = default; |
+ ~TilingIterator(); |
bool done() const { return current_tile_ == nullptr; } |
const Tile* operator*() const { return current_tile_; } |
@@ -118,6 +134,7 @@ class CC_EXPORT TilingSetRasterQueueAll { |
switch (phase_) { |
case VISIBLE_RECT: |
return TilePriority::NOW; |
+ case PENDING_VISIBLE_RECT: |
case SKEWPORT_RECT: |
case SOON_BORDER_RECT: |
return TilePriority::SOON; |
@@ -131,8 +148,14 @@ class CC_EXPORT TilingSetRasterQueueAll { |
TilingIterator& operator++(); |
private: |
+ // PENDING VISIBLE RECT refers to the visible rect that will become current |
+ // upon activation (ie, the pending tree's visible rect). Tiles in this |
+ // region that are not part of the current visible rect are all handled |
+ // here. Note that when processing a pending tree, this rect is the same as |
+ // the visible rect so no tiles are processed in this case. |
enum Phase { |
VISIBLE_RECT, |
+ PENDING_VISIBLE_RECT, |
SKEWPORT_RECT, |
SOON_BORDER_RECT, |
EVENTUALLY_RECT |
@@ -147,26 +170,34 @@ class CC_EXPORT TilingSetRasterQueueAll { |
Tile* current_tile_; |
VisibleTilingIterator visible_iterator_; |
+ PendingVisibleTilingIterator pending_visible_iterator_; |
SkewportTilingIterator skewport_iterator_; |
SoonBorderTilingIterator soon_border_iterator_; |
EventuallyTilingIterator eventually_iterator_; |
}; |
- enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS }; |
+ enum IteratorType { |
+ LOW_RES, |
+ HIGH_RES, |
+ ACTIVE_NON_IDEAL_PENDING_HIGH_RES, |
+ NUM_ITERATORS |
+ }; |
void AdvanceToNextStage(); |
PictureLayerTilingSet* tiling_set_; |
struct IterationStage { |
+ IterationStage(IteratorType type, TilePriority::PriorityBin bin); |
IteratorType iterator_type; |
TilePriority::PriorityBin tile_type; |
}; |
size_t current_stage_; |
- // One low res stage, and three high res stages. |
- IterationStage stages_[4]; |
+ // The max number of stages is 6: 1 low res, 3 high res, and 2 active non |
+ // ideal pending high res. |
+ base::StackVector<IterationStage, 6> stages_; |
TilingIterator iterators_[NUM_ITERATORS]; |
}; |