| Index: cc/resources/tile_manager.cc
|
| diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
|
| index 38948c3fa1ab921b01864c448fb5e7fb3d74ee65..7929237dd657bc9dd9962c22684dc69748829a83 100644
|
| --- a/cc/resources/tile_manager.cc
|
| +++ b/cc/resources/tile_manager.cc
|
| @@ -685,6 +685,18 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
|
| }
|
| }
|
|
|
| +void TileManager::CleanUpLayers() {
|
| + for (int i = 0; i < static_cast<int>(layers_.size()); ++i) {
|
| + if (layers_[i]->is_render_surface_list_member())
|
| + continue;
|
| +
|
| + layers_[i]->DidUnregisterLayer();
|
| + std::swap(layers_[i], layers_.back());
|
| + layers_.pop_back();
|
| + --i;
|
| + }
|
| +}
|
| +
|
| void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
|
| TRACE_EVENT0("cc", "TileManager::ManageTiles");
|
|
|
| @@ -694,6 +706,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_) {
|
|
|