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