| Index: cc/resources/tile_manager.cc
|
| diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
|
| index d8fb17d5b5c3d1e93c893b1903b6f89aba9066ae..8180c5efc439759fae92e3a268c6b5b01bfa5a7c 100644
|
| --- a/cc/resources/tile_manager.cc
|
| +++ b/cc/resources/tile_manager.cc
|
| @@ -685,6 +685,19 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
|
| }
|
| }
|
|
|
| +void TileManager::CleanUpLayers() {
|
| + for (size_t i = 0; i < layers_.size(); ++i) {
|
| + if (layers_[i]->IsDrawnRenderSurfaceLayerListMember())
|
| + continue;
|
| +
|
| + layers_[i]->DidUnregisterLayer();
|
| + std::swap(layers_[i], layers_.back());
|
| + layers_.pop_back();
|
| + --i;
|
| + prioritized_tiles_dirty_ = true;
|
| + }
|
| +}
|
| +
|
| void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
|
| TRACE_EVENT0("cc", "TileManager::ManageTiles");
|
|
|
| @@ -694,6 +707,8 @@ void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
|
| prioritized_tiles_dirty_ = true;
|
| }
|
|
|
| + CleanUpLayers();
|
| +
|
| // We need to call CheckForCompletedTasks() once in-between each call
|
| // to ScheduleTasks() to prevent canceled tasks from being scheduled.
|
| if (!did_check_for_completed_tasks_since_last_schedule_tasks_) {
|
|
|