Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1984)

Unified Diff: cc/resources/picture_layer_tiling.h

Issue 12865017: Makes tile-creation lazy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/resources/picture_layer_tiling.h
diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h
index 7a71fa8c92768e19dc83e4896709d52717bddf68..ef6c3856e36e550fefb18e0e4f7462a7051fb286 100644
--- a/cc/resources/picture_layer_tiling.h
+++ b/cc/resources/picture_layer_tiling.h
@@ -26,11 +26,14 @@ class PictureLayerTilingClient {
// tiling) This might return null if the client cannot create such a tile.
virtual scoped_refptr<Tile> CreateTile(
PictureLayerTiling* tiling,
- gfx::Rect content_rect) = 0;
+ const gfx::Rect& content_rect,
+ const gfx::Rect& paint_rect) = 0;
virtual void UpdatePile(Tile* tile) = 0;
virtual gfx::Size CalculateTileSize(
gfx::Size current_tile_size,
gfx::Size content_bounds) = 0;
+ virtual const Region* GetInvalidation() = 0;
+ virtual const PictureLayerTiling* GetSibling(const PictureLayerTiling* tiling) = 0;
};
class CC_EXPORT PictureLayerTiling {
@@ -43,7 +46,6 @@ class CC_EXPORT PictureLayerTiling {
gfx::Size layer_bounds() const { return layer_bounds_; }
void SetLayerBounds(gfx::Size layer_bounds);
- void Invalidate(const Region& layer_invalidation);
// Add any tiles that intersect with |layer_rect|. If any tiles already
// exist, then this leaves them as-is.
@@ -146,22 +148,49 @@ class CC_EXPORT PictureLayerTiling {
typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;
PictureLayerTiling(float contents_scale);
+ PictureLayerTiling(const PictureLayerTiling& other, int);
Tile* TileAt(int, int) const;
void CreateTilesFromContentRect(gfx::Rect layer_rect);
void CreateTile(int i, int j);
- PictureLayerTilingClient* client_;
+ // Given properties.
float contents_scale_;
gfx::Size layer_bounds_;
- gfx::Rect last_prioritized_rect_;
- // It is not legal to have a NULL tile in the tiles_ map.
- TileMap tiles_;
- TilingData tiling_data_;
TileResolution resolution_;
+ PictureLayerTilingClient* client_;
+
+ // Internal data.
+ TilingData tiling_data_;
+ TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map.
+
+ // State saved for computing velocities based upon finite differences.
+ gfx::Rect interest_rect_;
+ gfx::Rect last_interest_rect_;
int last_source_frame_number_;
double last_impl_frame_time_;
- friend class Iterator;
+ // An iterator that iterates over the TileMapKeys within a gfx::Rect.
enne (OOO) 2013/03/27 16:16:27 Do you need a new iterator class here? Why not jus
+ class CC_EXPORT SimpleIterator {
+ public:
+ SimpleIterator(const PictureLayerTiling* tiling,
+ const gfx::Rect& rect); // we assume rect is contained
enne (OOO) 2013/03/27 16:16:27 Please don't make multi-line comments at the end o
+ // within tiling's content
+
+ TileMapKey operator->() const { return key_; }
+ TileMapKey operator*() const { return key_; }
+
+ SimpleIterator& operator++();
+ operator bool() const { return key_.second < bottom_; }
+
+ private:
+ TileMapKey key_;
+ int left_;
+ int right_; // left_ <= key_.first < right_
+ int bottom_; // key_.second < bottom_
+ };
+
+ void ManageTiles(const gfx::Rect& old_interest_rect,
+ const gfx::Rect& new_interest_rect);
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698