| Index: cc/resources/picture_layer_tiling.h
|
| diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h
|
| index 407a2ad74d0e4cade0e2becaa889fb776e040c5d..233c54bc1710edab74dd69929c5b98a6597439f3 100644
|
| --- a/cc/resources/picture_layer_tiling.h
|
| +++ b/cc/resources/picture_layer_tiling.h
|
| @@ -45,6 +45,48 @@ class CC_EXPORT PictureLayerTilingClient {
|
|
|
| class CC_EXPORT PictureLayerTiling {
|
| public:
|
| + class CC_EXPORT TilingRasterTileIterator {
|
| + public:
|
| + TilingRasterTileIterator();
|
| + explicit TilingRasterTileIterator(PictureLayerTiling* tiling);
|
| + ~TilingRasterTileIterator();
|
| +
|
| + operator bool() const {
|
| + return tiling_ && tiling_->RasterTileForPriority(current_index_);
|
| + }
|
| + void operator++();
|
| + Tile* operator*() { return tiling_->RasterTileForPriority(current_index_); }
|
| +
|
| + bool HasVisibleTiles() const {
|
| + if (!tiling_)
|
| + return false;
|
| + return tiling_->HasVisibleTilesAtOrAfterPriority(current_index_);
|
| + }
|
| +
|
| + private:
|
| + PictureLayerTiling* tiling_;
|
| + size_t current_index_;
|
| + };
|
| +
|
| + class TilingEvictionTileIterator {
|
| + public:
|
| + TilingEvictionTileIterator();
|
| + explicit TilingEvictionTileIterator(PictureLayerTiling* tiling);
|
| + ~TilingEvictionTileIterator();
|
| +
|
| + operator bool() const {
|
| + return tiling_ && tiling_->EvictionTileForPriority(current_index_);
|
| + }
|
| + void operator++();
|
| + Tile* operator*() {
|
| + return tiling_->EvictionTileForPriority(current_index_);
|
| + }
|
| +
|
| + private:
|
| + PictureLayerTiling* tiling_;
|
| + size_t current_index_;
|
| + };
|
| +
|
| ~PictureLayerTiling();
|
|
|
| // Create a tiling with no tiles. CreateTiles must be called to add some.
|
| @@ -159,6 +201,8 @@ class CC_EXPORT PictureLayerTiling {
|
| return frame_time_in_seconds != last_impl_frame_time_in_seconds_;
|
| }
|
|
|
| + size_t RequiredGPUMemoryInBytes() const;
|
| +
|
| scoped_ptr<base::Value> AsValue() const;
|
| size_t GPUMemoryUsageInBytes() const;
|
|
|
| @@ -183,6 +227,9 @@ class CC_EXPORT PictureLayerTiling {
|
| }
|
|
|
| protected:
|
| + friend class TilingRasterTileIterator;
|
| + friend class TilingEvictionTileIterator;
|
| +
|
| typedef std::pair<int, int> TileMapKey;
|
| typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;
|
|
|
| @@ -200,6 +247,10 @@ class CC_EXPORT PictureLayerTiling {
|
| const gfx::Rect& visible_rect_in_content_space)
|
| const;
|
|
|
| + Tile* RasterTileForPriority(size_t priority_index);
|
| + Tile* EvictionTileForPriority(size_t priority_index);
|
| + bool HasVisibleTilesAtOrAfterPriority(size_t prioroity_index) const;
|
| +
|
| // Given properties.
|
| float contents_scale_;
|
| gfx::Size layer_bounds_;
|
| @@ -213,7 +264,18 @@ class CC_EXPORT PictureLayerTiling {
|
|
|
| // State saved for computing velocities based upon finite differences.
|
| double last_impl_frame_time_in_seconds_;
|
| - gfx::RectF last_visible_rect_in_content_space_;
|
| + gfx::Rect last_visible_rect_in_content_space_;
|
| +
|
| + // Tile bins used to return tiles in raster and eviction iterators.
|
| + std::vector<Tile*> visible_tiles_;
|
| + std::vector<Tile*> skewport_tiles_;
|
| + bool skewport_tiles_sorted_;
|
| + std::vector<Tile*> eventually_tiles_;
|
| + bool eventually_tiles_sorted_;
|
| + std::vector<Tile*> eviction_tiles_;
|
| + bool eviction_tiles_sorted_;
|
| +
|
| + WhichTree last_update_tree_;
|
|
|
| friend class CoverageIterator;
|
|
|
|
|