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

Unified Diff: cc/resources/picture_layer_tiling.h

Issue 820703002: c:: Give the raster source to the PictureLayerTilings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 05db0b037d9dee43095aea4707fe8fe1a832f3cc..329353d18faadf2f57aa698859b4b893461c86ea 100644
--- a/cc/resources/picture_layer_tiling.h
+++ b/cc/resources/picture_layer_tiling.h
@@ -35,9 +35,8 @@ class CC_EXPORT PictureLayerTilingClient {
public:
// Create a tile at the given content_rect (in the contents scale of the
// tiling) This might return null if the client cannot create such a tile.
- virtual scoped_refptr<Tile> CreateTile(
- PictureLayerTiling* tiling,
- const gfx::Rect& content_rect) = 0;
+ virtual scoped_refptr<Tile> CreateTile(float contents_scale,
+ const gfx::Rect& content_rect) = 0;
virtual gfx::Size CalculateTileSize(
const gfx::Size& content_bounds) const = 0;
// This invalidation region defines the area (if any, it can by null) that
@@ -108,21 +107,20 @@ class CC_EXPORT PictureLayerTiling {
~PictureLayerTiling();
- // Create a tiling with no tiles. CreateTiles must be called to add some.
- // TODO(danakj): Pass the raster_source here instead of the size, store the
- // raster source instead of layer bounds?
+ // Create a tiling with no tiles. CreateTile() must be called to add some.
static scoped_ptr<PictureLayerTiling> Create(
float contents_scale,
- const gfx::Size& layer_bounds,
+ scoped_refptr<RasterSource> raster_source,
PictureLayerTilingClient* client,
size_t max_tiles_for_interest_area,
float skewport_target_time_in_seconds,
int skewport_extrapolation_limit_in_content_pixels);
- gfx::Size layer_bounds() const { return layer_bounds_; }
- void Resize(const gfx::Size& new_layer_bounds);
+ RasterSource* raster_source() const { return raster_source_.get(); }
+
+ void SetRasterSourceAndResize(scoped_refptr<RasterSource> raster_source);
void Invalidate(const Region& layer_invalidation);
- void SetRasterSource(scoped_refptr<RasterSource> raster_source);
+ void SetRasterSourceOnTiles();
void CreateMissingTilesInLiveTilesRect();
void CloneTilesAndPropertiesFrom(const PictureLayerTiling& twin_tiling);
@@ -274,7 +272,7 @@ class CC_EXPORT PictureLayerTiling {
typedef base::hash_map<TileMapKey, scoped_refptr<Tile>> TileMap;
PictureLayerTiling(float contents_scale,
- const gfx::Size& layer_bounds,
+ scoped_refptr<RasterSource> raster_source,
PictureLayerTilingClient* client,
size_t max_tiles_for_interest_area,
float skewport_target_time_in_seconds,
@@ -320,7 +318,7 @@ class CC_EXPORT PictureLayerTiling {
// Given properties.
const float contents_scale_;
PictureLayerTilingClient* const client_;
- gfx::Size layer_bounds_;
+ scoped_refptr<RasterSource> raster_source_;
TileResolution resolution_;
// Internal data.

Powered by Google App Engine
This is Rietveld 408576698