| 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 #ifndef CC_TILES_TILE_MANAGER_H_ | 5 #ifndef CC_TILES_TILE_MANAGER_H_ |
| 6 #define CC_TILES_TILE_MANAGER_H_ | 6 #define CC_TILES_TILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 int resource_count_; | 241 int resource_count_; |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 void OnRasterTaskCompleted( | 244 void OnRasterTaskCompleted( |
| 245 Tile::Id tile, | 245 Tile::Id tile, |
| 246 Resource* resource, | 246 Resource* resource, |
| 247 bool was_canceled); | 247 bool was_canceled); |
| 248 | 248 |
| 249 void FreeResourcesForTile(Tile* tile); | 249 void FreeResourcesForTile(Tile* tile); |
| 250 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); | 250 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); |
| 251 scoped_refptr<RasterTask> CreateRasterTask( | 251 scoped_refptr<Task> CreateRasterTask(const PrioritizedTile& prioritized_tile); |
| 252 const PrioritizedTile& prioritized_tile); | |
| 253 | 252 |
| 254 scoped_ptr<EvictionTilePriorityQueue> | 253 scoped_ptr<EvictionTilePriorityQueue> |
| 255 FreeTileResourcesUntilUsageIsWithinLimit( | 254 FreeTileResourcesUntilUsageIsWithinLimit( |
| 256 scoped_ptr<EvictionTilePriorityQueue> eviction_priority_queue, | 255 scoped_ptr<EvictionTilePriorityQueue> eviction_priority_queue, |
| 257 const MemoryUsage& limit, | 256 const MemoryUsage& limit, |
| 258 MemoryUsage* usage); | 257 MemoryUsage* usage); |
| 259 scoped_ptr<EvictionTilePriorityQueue> | 258 scoped_ptr<EvictionTilePriorityQueue> |
| 260 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit( | 259 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit( |
| 261 scoped_ptr<EvictionTilePriorityQueue> eviction_priority_queue, | 260 scoped_ptr<EvictionTilePriorityQueue> eviction_priority_queue, |
| 262 const MemoryUsage& limit, | 261 const MemoryUsage& limit, |
| 263 const TilePriority& oother_priority, | 262 const TilePriority& oother_priority, |
| 264 MemoryUsage* usage); | 263 MemoryUsage* usage); |
| 265 bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority); | 264 bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority); |
| 266 bool AreRequiredTilesReadyToDraw(RasterTilePriorityQueue::Type type) const; | 265 bool AreRequiredTilesReadyToDraw(RasterTilePriorityQueue::Type type) const; |
| 267 void CheckIfMoreTilesNeedToBePrepared(); | 266 void CheckIfMoreTilesNeedToBePrepared(); |
| 268 void CheckAndIssueSignals(); | 267 void CheckAndIssueSignals(); |
| 269 bool MarkTilesOutOfMemory(scoped_ptr<RasterTilePriorityQueue> queue) const; | 268 bool MarkTilesOutOfMemory(scoped_ptr<RasterTilePriorityQueue> queue) const; |
| 270 | 269 |
| 271 ResourceFormat DetermineResourceFormat(const Tile* tile) const; | 270 ResourceFormat DetermineResourceFormat(const Tile* tile) const; |
| 272 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; | 271 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; |
| 273 | 272 |
| 274 void DidFinishRunningTileTasksRequiredForActivation(); | 273 void DidFinishRunningTileTasksRequiredForActivation(); |
| 275 void DidFinishRunningTileTasksRequiredForDraw(); | 274 void DidFinishRunningTileTasksRequiredForDraw(); |
| 276 void DidFinishRunningAllTileTasks(); | 275 void DidFinishRunningAllTileTasks(); |
| 277 | 276 |
| 278 scoped_refptr<TileTask> CreateTaskSetFinishedTask( | 277 scoped_refptr<Task> CreateTaskSetFinishedTask( |
| 279 void (TileManager::*callback)()); | 278 void (TileManager::*callback)()); |
| 280 | 279 |
| 281 scoped_ptr<base::trace_event::ConvertableToTraceFormat> | 280 scoped_ptr<base::trace_event::ConvertableToTraceFormat> |
| 282 ScheduledTasksStateAsValue() const; | 281 ScheduledTasksStateAsValue() const; |
| 283 | 282 |
| 284 TileManagerClient* client_; | 283 TileManagerClient* client_; |
| 285 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 284 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 286 ResourcePool* resource_pool_; | 285 ResourcePool* resource_pool_; |
| 287 TileTaskRunner* tile_task_runner_; | 286 TileTaskRunner* tile_task_runner_; |
| 288 GlobalStateThatImpactsTilePriority global_state_; | 287 GlobalStateThatImpactsTilePriority global_state_; |
| 289 size_t scheduled_raster_task_limit_; | 288 size_t scheduled_raster_task_limit_; |
| 290 const bool use_partial_raster_; | 289 const bool use_partial_raster_; |
| 291 bool use_gpu_rasterization_; | 290 bool use_gpu_rasterization_; |
| 292 | 291 |
| 293 using TileMap = std::unordered_map<Tile::Id, Tile*>; | 292 using TileMap = std::unordered_map<Tile::Id, Tile*>; |
| 294 TileMap tiles_; | 293 TileMap tiles_; |
| 295 | 294 |
| 296 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; | 295 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; |
| 297 MemoryHistory::Entry memory_stats_from_last_assign_; | 296 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 298 | 297 |
| 299 bool did_check_for_completed_tasks_since_last_schedule_tasks_; | 298 bool did_check_for_completed_tasks_since_last_schedule_tasks_; |
| 300 bool did_oom_on_last_assign_; | 299 bool did_oom_on_last_assign_; |
| 301 | 300 |
| 302 ImageDecodeController* image_decode_controller_; | 301 ImageDecodeController* image_decode_controller_; |
| 303 | 302 |
| 304 RasterTaskCompletionStats flush_stats_; | 303 RasterTaskCompletionStats flush_stats_; |
| 305 | 304 |
| 306 std::vector<Tile*> released_tiles_; | 305 std::vector<Tile*> released_tiles_; |
| 307 | 306 |
| 308 std::vector<scoped_refptr<TileTask>> orphan_tasks_; | 307 std::vector<scoped_refptr<Task>> orphan_tasks_; |
| 309 | 308 |
| 310 TaskGraph graph_; | 309 TaskGraph graph_; |
| 311 scoped_refptr<TileTask> required_for_activation_done_task_; | 310 scoped_refptr<Task> required_for_activation_done_task_; |
| 312 scoped_refptr<TileTask> required_for_draw_done_task_; | 311 scoped_refptr<Task> required_for_draw_done_task_; |
| 313 scoped_refptr<TileTask> all_done_task_; | 312 scoped_refptr<Task> all_done_task_; |
| 314 | 313 |
| 315 UniqueNotifier more_tiles_need_prepare_check_notifier_; | 314 UniqueNotifier more_tiles_need_prepare_check_notifier_; |
| 316 | 315 |
| 317 struct Signals { | 316 struct Signals { |
| 318 Signals(); | 317 Signals(); |
| 319 | 318 |
| 320 void reset(); | 319 void reset(); |
| 321 | 320 |
| 322 bool ready_to_activate; | 321 bool ready_to_activate; |
| 323 bool did_notify_ready_to_activate; | 322 bool did_notify_ready_to_activate; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 337 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; | 336 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
| 338 | 337 |
| 339 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 338 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
| 340 | 339 |
| 341 DISALLOW_COPY_AND_ASSIGN(TileManager); | 340 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 342 }; | 341 }; |
| 343 | 342 |
| 344 } // namespace cc | 343 } // namespace cc |
| 345 | 344 |
| 346 #endif // CC_TILES_TILE_MANAGER_H_ | 345 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |