OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/resources/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 mts.tile_versions[mts.raster_mode]; | 971 mts.tile_versions[mts.raster_mode]; |
972 | 972 |
973 DCHECK(tile_version.requires_resource()); | 973 DCHECK(tile_version.requires_resource()); |
974 DCHECK(!tile_version.resource_); | 974 DCHECK(!tile_version.resource_); |
975 | 975 |
976 if (!tile_version.raster_task_.get()) | 976 if (!tile_version.raster_task_.get()) |
977 tile_version.raster_task_ = CreateRasterTask(tile); | 977 tile_version.raster_task_ = CreateRasterTask(tile); |
978 | 978 |
979 raster_queue_.items.push_back(RasterTaskQueue::Item( | 979 raster_queue_.items.push_back(RasterTaskQueue::Item( |
980 tile_version.raster_task_.get(), tile->required_for_activation())); | 980 tile_version.raster_task_.get(), tile->required_for_activation())); |
981 raster_queue_.required_for_activation_count += | |
982 tile->required_for_activation(); | |
983 } | 981 } |
984 | 982 |
985 // We must reduce the amount of unused resoruces before calling | 983 // We must reduce the amount of unused resoruces before calling |
986 // ScheduleTasks to prevent usage from rising above limits. | 984 // ScheduleTasks to prevent usage from rising above limits. |
987 resource_pool_->ReduceResourceUsage(); | 985 resource_pool_->ReduceResourceUsage(); |
988 | 986 |
989 // Schedule running of |raster_tasks_|. This replaces any previously | 987 // Schedule running of |raster_tasks_|. This replaces any previously |
990 // scheduled tasks and effectively cancels all tasks not present | 988 // scheduled tasks and effectively cancels all tasks not present |
991 // in |raster_tasks_|. | 989 // in |raster_tasks_|. |
992 rasterizer_->ScheduleTasks(&raster_queue_); | 990 rasterizer_->ScheduleTasks(&raster_queue_); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); | 1169 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); |
1172 | 1170 |
1173 rasterizer_->CheckForCompletedTasks(); | 1171 rasterizer_->CheckForCompletedTasks(); |
1174 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1172 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
1175 | 1173 |
1176 if (IsReadyToActivate()) | 1174 if (IsReadyToActivate()) |
1177 client_->NotifyReadyToActivate(); | 1175 client_->NotifyReadyToActivate(); |
1178 } | 1176 } |
1179 | 1177 |
1180 } // namespace cc | 1178 } // namespace cc |
OLD | NEW |