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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 716283003: cc: Remove GetRasterSource from PictureLayerTilingClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ::Create instead of ctor Created 6 years, 1 month 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 6d8914033e1d43802052d9f9302bb656a1b9e657..afb78f5ae268555f6f56c14f366bfaaa82918ed8 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -122,14 +122,16 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
twin_layer_ = layer_impl;
layer_impl->twin_layer_ = this;
- layer_impl->UpdateRasterSource(raster_source_);
-
DCHECK(!raster_source_->IsSolidColor() || !tilings_->num_tilings());
// Tilings would be expensive to push, so we swap.
layer_impl->tilings_.swap(tilings_);
layer_impl->tilings_->SetClient(layer_impl);
- if (tilings_)
+ if (tilings_) {
tilings_->SetClient(this);
+ tilings_->SetRasterSource(raster_source_.get());
+ }
+
+ layer_impl->UpdateRasterSource(raster_source_);
// Ensure that the recycle tree doesn't have any unshared tiles.
if (tilings_ && raster_source_->IsSolidColor())
@@ -167,6 +169,9 @@ void PictureLayerImpl::UpdateRasterSource(
if (could_have_tilings != CanHaveTilings()) {
layer_tree_impl()->set_needs_update_draw_properties();
}
+
+ if (tilings_)
+ tilings_->SetRasterSource(raster_source_.get());
}
void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
@@ -632,10 +637,6 @@ scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
flags);
}
-RasterSource* PictureLayerImpl::GetRasterSource() {
- return raster_source_.get();
-}
-
const Region* PictureLayerImpl::GetPendingInvalidation() {
if (layer_tree_impl()->IsPendingTree())
return &invalidation_;
@@ -865,7 +866,7 @@ void PictureLayerImpl::DoPostCommitInitialization() {
DCHECK(layer_tree_impl()->IsPendingTree());
if (!tilings_)
- tilings_ = make_scoped_ptr(new PictureLayerTilingSet(this));
+ tilings_ = PictureLayerTilingSet::Create(this, raster_source_.get());
PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer();
if (twin_layer) {

Powered by Google App Engine
This is Rietveld 408576698