Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index 1827bea13d8923746825029c691e5b731226c0c1..b071c56aed3b4385e0d7adf82e4523bf68be05e8 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -598,11 +598,21 @@ void PictureLayerImpl::DidBeginTracing() { |
| raster_source_->DidBeginTracing(); |
| } |
| -void PictureLayerImpl::ReleaseResources() { |
| - if (tilings_) |
| - RemoveAllTilings(); |
| +void PictureLayerImpl::ResetTileCache() { |
| + RemoveAllTilings(); |
| + if (!tilings_) |
| + return; |
| - ResetRasterScale(); |
| + // Reset the settings. |
| + // TODO(vmpstr): Should this funciton set tilings_ to nullptr instead? |
|
enne (OOO)
2014/12/02 21:25:58
I'm not sure. I think previously PictureLayerImpl
danakj
2014/12/02 21:58:37
I'd like to not deal with nullptrs. With my CL it'
|
| + tilings_->SetMaxTilesForInterestArea(GetMaxTilesForInterestArea()); |
| + tilings_->SetSkewportTargetTimeInSeconds(GetSkewportTargetTimeInSeconds()); |
| + tilings_->SetSkewportExtrapolationLimitInContentPixels( |
| + GetSkewportExtrapolationLimitInContentPixels()); |
| +} |
| + |
| +void PictureLayerImpl::ReleaseResources() { |
| + ResetTileCache(); |
| // To avoid an edge case after lost context where the tree is up to date but |
| // the tilings have not been managed, request an update draw properties |
| @@ -865,8 +875,11 @@ void PictureLayerImpl::DoPostCommitInitialization() { |
| DCHECK(needs_post_commit_initialization_); |
| DCHECK(layer_tree_impl()->IsPendingTree()); |
| - if (!tilings_) |
| - tilings_ = PictureLayerTilingSet::Create(this); |
| + if (!tilings_) { |
| + tilings_ = PictureLayerTilingSet::Create( |
| + this, GetMaxTilesForInterestArea(), GetSkewportTargetTimeInSeconds(), |
| + GetSkewportExtrapolationLimitInContentPixels()); |
| + } |
| PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer(); |
| if (twin_layer) { |