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 02fb92fb735dce8d5048487eebe38ab6800c7706..b27a94785f19e8174df7b448a973221b1bd70017 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -1201,18 +1201,27 @@ void PictureLayerImpl::CleanUpTilingsOnActiveLayer( |
| to_remove.push_back(tiling); |
| } |
| + if (to_remove.empty()) |
| + return; |
| + |
| + PictureLayerImpl* recycled_twin = static_cast<PictureLayerImpl*>( |
| + layer_tree_impl()->FindRecycleTreeLayerById(id())); |
| + // Remove tilings on this tree and the twin tree. |
| for (size_t i = 0; i < to_remove.size(); ++i) { |
| const PictureLayerTiling* twin_tiling = GetTwinTiling(to_remove[i]); |
| // Only remove tilings from the twin layer if they have |
| // NON_IDEAL_RESOLUTION. |
| if (twin_tiling && twin_tiling->resolution() == NON_IDEAL_RESOLUTION) |
| twin->RemoveTiling(to_remove[i]->contents_scale()); |
| + // Remove the tiling from the recycle tree. |
|
danakj
2014/07/18 18:34:58
nit: mention we're ignoring it resolution because
vmpstr
2014/07/18 23:21:12
Done.
|
| + if (recycled_twin) |
| + recycled_twin->RemoveTiling(to_remove[i]->contents_scale()); |
| // TODO(enne): temporary sanity CHECK for http://crbug.com/358350 |
| CHECK_NE(HIGH_RESOLUTION, to_remove[i]->resolution()); |
| tilings_->Remove(to_remove[i]); |
| } |
| - DCHECK_GT(tilings_->num_tilings(), 0u); |
| + DCHECK_GT(tilings_->num_tilings(), 0u); |
| SanityCheckTilingState(); |
| } |
| @@ -1261,6 +1270,10 @@ bool PictureLayerImpl::CanHaveTilingWithScale(float contents_scale) const { |
| void PictureLayerImpl::SanityCheckTilingState() const { |
| #if DCHECK_IS_ON |
| + // Recycle tree doesn't have any restrictions. |
| + if (layer_tree_impl()->IsRecycleTree()) |
| + return; |
| + |
| if (!CanHaveTilings()) { |
| DCHECK_EQ(0u, tilings_->num_tilings()); |
| return; |