Chromium Code Reviews| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 void CheckAndIssueSignals(); | 285 void CheckAndIssueSignals(); |
| 286 bool MarkTilesOutOfMemory( | 286 bool MarkTilesOutOfMemory( |
| 287 std::unique_ptr<RasterTilePriorityQueue> queue) const; | 287 std::unique_ptr<RasterTilePriorityQueue> queue) const; |
| 288 | 288 |
| 289 ResourceFormat DetermineResourceFormat(const Tile* tile) const; | 289 ResourceFormat DetermineResourceFormat(const Tile* tile) const; |
| 290 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; | 290 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; |
| 291 | 291 |
| 292 void DidFinishRunningTileTasksRequiredForActivation(); | 292 void DidFinishRunningTileTasksRequiredForActivation(); |
| 293 void DidFinishRunningTileTasksRequiredForDraw(); | 293 void DidFinishRunningTileTasksRequiredForDraw(); |
| 294 void DidFinishRunningAllTileTasks(); | 294 void DidFinishRunningAllTileTasks(); |
| 295 void RequiredForActivationTilesAreReadyToDraw(uint64_t callback_id); | |
| 295 | 296 |
| 296 scoped_refptr<TileTask> CreateTaskSetFinishedTask( | 297 scoped_refptr<TileTask> CreateTaskSetFinishedTask( |
| 297 void (TileManager::*callback)()); | 298 void (TileManager::*callback)()); |
| 298 PrioritizedWorkToSchedule AssignGpuMemoryToTiles(); | 299 PrioritizedWorkToSchedule AssignGpuMemoryToTiles(); |
| 299 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule); | 300 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule); |
| 300 | 301 |
| 301 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 302 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 302 ScheduledTasksStateAsValue() const; | 303 ScheduledTasksStateAsValue() const; |
| 303 | 304 |
| 304 bool UsePartialRaster() const; | 305 bool UsePartialRaster() const; |
| 305 | 306 |
| 306 TileManagerClient* client_; | 307 TileManagerClient* client_ = nullptr; |
| 307 base::SequencedTaskRunner* task_runner_; | 308 base::SequencedTaskRunner* task_runner_ = nullptr; |
| 308 ResourcePool* resource_pool_; | 309 ResourcePool* resource_pool_ = nullptr; |
| 309 std::unique_ptr<TileTaskManager> tile_task_manager_; | 310 std::unique_ptr<TileTaskManager> tile_task_manager_; |
| 310 RasterBufferProvider* raster_buffer_provider_; | 311 RasterBufferProvider* raster_buffer_provider_ = nullptr; |
| 311 GlobalStateThatImpactsTilePriority global_state_; | 312 GlobalStateThatImpactsTilePriority global_state_; |
| 312 size_t scheduled_raster_task_limit_; | 313 size_t scheduled_raster_task_limit_ = 0; |
| 313 const bool use_partial_raster_; | 314 const bool use_partial_raster_ = false; |
| 314 bool use_gpu_rasterization_; | 315 bool use_gpu_rasterization_ = false; |
| 315 | 316 |
| 316 std::unordered_map<Tile::Id, Tile*> tiles_; | 317 std::unordered_map<Tile::Id, Tile*> tiles_; |
| 317 | 318 |
| 318 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; | 319 bool all_tiles_that_need_to_be_rasterized_are_scheduled_ = true; |
| 319 MemoryHistory::Entry memory_stats_from_last_assign_; | 320 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 320 | 321 |
| 321 bool did_check_for_completed_tasks_since_last_schedule_tasks_; | 322 bool did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
| 322 bool did_oom_on_last_assign_; | 323 bool did_oom_on_last_assign_ = false; |
| 323 | 324 |
| 324 ImageManager image_manager_; | 325 ImageManager image_manager_; |
| 325 | 326 |
| 326 RasterTaskCompletionStats flush_stats_; | 327 RasterTaskCompletionStats flush_stats_; |
| 327 | 328 |
| 328 std::vector<Tile*> released_tiles_; | 329 std::vector<Tile*> released_tiles_; |
| 329 | 330 |
| 330 std::vector<scoped_refptr<TileTask>> orphan_tasks_; | 331 std::vector<scoped_refptr<TileTask>> orphan_tasks_; |
| 331 | 332 |
| 332 TaskGraph graph_; | 333 TaskGraph graph_; |
| 333 scoped_refptr<TileTask> required_for_activation_done_task_; | 334 scoped_refptr<TileTask> required_for_activation_done_task_; |
| 334 scoped_refptr<TileTask> required_for_draw_done_task_; | 335 scoped_refptr<TileTask> required_for_draw_done_task_; |
| 335 scoped_refptr<TileTask> all_done_task_; | 336 scoped_refptr<TileTask> all_done_task_; |
| 336 | 337 |
| 337 UniqueNotifier more_tiles_need_prepare_check_notifier_; | 338 UniqueNotifier more_tiles_need_prepare_check_notifier_; |
| 338 | 339 |
| 339 Signals signals_; | 340 Signals signals_; |
| 340 | 341 |
| 341 UniqueNotifier signals_check_notifier_; | 342 UniqueNotifier signals_check_notifier_; |
| 342 | 343 |
| 343 bool has_scheduled_tile_tasks_; | 344 bool has_scheduled_tile_tasks_ = false; |
| 344 | 345 |
| 345 uint64_t prepare_tiles_count_; | 346 uint64_t prepare_tiles_count_ = 0u; |
| 346 uint64_t next_tile_id_; | 347 uint64_t next_tile_id_ = 0u; |
| 347 | 348 |
| 348 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; | 349 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
| 349 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; | 350 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; |
| 350 | 351 |
| 352 uint64_t pending_activation_callback_id_ = 0; | |
| 353 | |
| 351 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 354 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
| 355 base::WeakPtrFactory<TileManager> weak_ptr_factory_; | |
|
vmpstr
2016/12/07 21:00:25
I'm assuming the two weakptrfactories here have di
| |
| 352 | 356 |
| 353 DISALLOW_COPY_AND_ASSIGN(TileManager); | 357 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 354 }; | 358 }; |
| 355 | 359 |
| 356 } // namespace cc | 360 } // namespace cc |
| 357 | 361 |
| 358 #endif // CC_TILES_TILE_MANAGER_H_ | 362 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |