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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // This class manages tiles, deciding which should get rasterized and which | 94 // This class manages tiles, deciding which should get rasterized and which |
95 // should no longer have any memory assigned to them. Tile objects are "owned" | 95 // should no longer have any memory assigned to them. Tile objects are "owned" |
96 // by layers; they automatically register with the manager when they are | 96 // by layers; they automatically register with the manager when they are |
97 // created, and unregister from the manager when they are deleted. | 97 // created, and unregister from the manager when they are deleted. |
98 class CC_EXPORT TileManager { | 98 class CC_EXPORT TileManager { |
99 public: | 99 public: |
100 TileManager(TileManagerClient* client, | 100 TileManager(TileManagerClient* client, |
101 base::SequencedTaskRunner* task_runner, | 101 base::SequencedTaskRunner* task_runner, |
102 size_t scheduled_raster_task_limit, | 102 size_t scheduled_raster_task_limit, |
103 bool use_partial_raster); | 103 bool use_partial_raster, |
| 104 bool check_tile_priority_inversion); |
104 virtual ~TileManager(); | 105 virtual ~TileManager(); |
105 | 106 |
106 // Assigns tile memory and schedules work to prepare tiles for drawing. | 107 // Assigns tile memory and schedules work to prepare tiles for drawing. |
107 // - Runs client_->NotifyReadyToActivate() when all tiles required for | 108 // - Runs client_->NotifyReadyToActivate() when all tiles required for |
108 // activation are prepared, or failed to prepare due to OOM. | 109 // activation are prepared, or failed to prepare due to OOM. |
109 // - Runs client_->NotifyReadyToDraw() when all tiles required draw are | 110 // - Runs client_->NotifyReadyToDraw() when all tiles required draw are |
110 // prepared, or failed to prepare due to OOM. | 111 // prepared, or failed to prepare due to OOM. |
111 bool PrepareTiles(const GlobalStateThatImpactsTilePriority& state); | 112 bool PrepareTiles(const GlobalStateThatImpactsTilePriority& state); |
112 | 113 |
113 // Synchronously finish any in progress work, cancel the rest, and clean up as | 114 // Synchronously finish any in progress work, cancel the rest, and clean up as |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 336 |
336 UniqueNotifier signals_check_notifier_; | 337 UniqueNotifier signals_check_notifier_; |
337 | 338 |
338 bool has_scheduled_tile_tasks_; | 339 bool has_scheduled_tile_tasks_; |
339 | 340 |
340 uint64_t prepare_tiles_count_; | 341 uint64_t prepare_tiles_count_; |
341 uint64_t next_tile_id_; | 342 uint64_t next_tile_id_; |
342 | 343 |
343 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; | 344 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
344 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; | 345 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; |
| 346 const bool check_tile_priority_inversion_; |
345 | 347 |
346 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 348 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
347 | 349 |
348 DISALLOW_COPY_AND_ASSIGN(TileManager); | 350 DISALLOW_COPY_AND_ASSIGN(TileManager); |
349 }; | 351 }; |
350 | 352 |
351 } // namespace cc | 353 } // namespace cc |
352 | 354 |
353 #endif // CC_TILES_TILE_MANAGER_H_ | 355 #endif // CC_TILES_TILE_MANAGER_H_ |
OLD | NEW |