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