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

Unified Diff: cc/layers/picture_layer_impl.cc

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/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 6778512f5468071ba8c0119cc84f9c9ee5dbb98d..cac7b4a4308712bfc472d3babbe4b1598a2b4364 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -638,12 +638,9 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
return raster_source_->GetFlattenedPicture();
}
-scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
- const gfx::Rect& content_rect) {
- DCHECK(!raster_source_->IsSolidColor());
- if (!raster_source_->CoversRect(content_rect, tiling->contents_scale()))
- return scoped_refptr<Tile>();
-
+scoped_refptr<Tile> PictureLayerImpl::CreateTile(
+ float contents_scale,
+ const gfx::Rect& content_rect) {
int flags = 0;
// We don't handle solid color masks, so we shouldn't bother analyzing those.
@@ -652,9 +649,8 @@ scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
flags = Tile::USE_PICTURE_ANALYSIS;
return layer_tree_impl()->tile_manager()->CreateTile(
- raster_source_.get(), content_rect.size(), content_rect,
- tiling->contents_scale(), id(), layer_tree_impl()->source_frame_number(),
- flags);
+ raster_source_.get(), content_rect.size(), content_rect, contents_scale,
+ id(), layer_tree_impl()->source_frame_number(), flags);
}
const Region* PictureLayerImpl::GetPendingInvalidation() {
@@ -818,7 +814,7 @@ PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
DCHECK_GE(contents_scale, MinimumContentsScale());
DCHECK_LE(contents_scale, MaximumContentsScale());
DCHECK(raster_source_->HasRecordings());
- return tilings_->AddTiling(contents_scale, raster_source_->GetSize());
+ return tilings_->AddTiling(contents_scale, raster_source_);
}
void PictureLayerImpl::RemoveAllTilings() {

Powered by Google App Engine
This is Rietveld 408576698