| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // Synchronously finish any in progress work, cancel the rest, and clean up as | 106 // Synchronously finish any in progress work, cancel the rest, and clean up as |
| 107 // much resources as possible. Also, prevents any future work until a | 107 // much resources as possible. Also, prevents any future work until a |
| 108 // SetResources call. | 108 // SetResources call. |
| 109 void FinishTasksAndCleanUp(); | 109 void FinishTasksAndCleanUp(); |
| 110 | 110 |
| 111 // Set the new given resource pool and tile task runner. Note that | 111 // Set the new given resource pool and tile task runner. Note that |
| 112 // FinishTasksAndCleanUp must be called in between consecutive calls to | 112 // FinishTasksAndCleanUp must be called in between consecutive calls to |
| 113 // SetResources. | 113 // SetResources. |
| 114 void SetResources(ResourcePool* resource_pool, | 114 void SetResources(ResourcePool* resource_pool, |
| 115 TileTaskRunner* tile_task_runner, | 115 TileTaskRunner* tile_task_runner, |
| 116 size_t scheduled_raster_task_limit); | 116 size_t scheduled_raster_task_limit, |
| 117 bool is_using_gpu_rasterization); |
| 117 | 118 |
| 118 // This causes any completed raster work to finalize, so that tiles get up to | 119 // This causes any completed raster work to finalize, so that tiles get up to |
| 119 // date draw information. | 120 // date draw information. |
| 120 void Flush(); | 121 void Flush(); |
| 121 | 122 |
| 122 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, | 123 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, |
| 123 int layer_id, | 124 int layer_id, |
| 124 int source_frame_number, | 125 int source_frame_number, |
| 125 int flags); | 126 int flags); |
| 126 | 127 |
| 127 bool IsReadyToActivate() const; | 128 bool IsReadyToActivate() const; |
| 128 bool IsReadyToDraw() const; | 129 bool IsReadyToDraw() const; |
| 129 | 130 |
| 131 ImageDecodeController* GetImageDecodeController() { |
| 132 return &image_decode_controller_; |
| 133 } |
| 134 |
| 130 scoped_refptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue() | 135 scoped_refptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue() |
| 131 const; | 136 const; |
| 132 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; | 137 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; |
| 133 const MemoryHistory::Entry& memory_stats_from_last_assign() const { | 138 const MemoryHistory::Entry& memory_stats_from_last_assign() const { |
| 134 return memory_stats_from_last_assign_; | 139 return memory_stats_from_last_assign_; |
| 135 } | 140 } |
| 136 | 141 |
| 137 // Public methods for testing. | 142 // Public methods for testing. |
| 138 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 143 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 139 for (size_t i = 0; i < tiles.size(); ++i) { | 144 for (size_t i = 0; i < tiles.size(); ++i) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 bool did_notify_all_tile_tasks_completed; | 330 bool did_notify_all_tile_tasks_completed; |
| 326 } signals_; | 331 } signals_; |
| 327 | 332 |
| 328 UniqueNotifier signals_check_notifier_; | 333 UniqueNotifier signals_check_notifier_; |
| 329 | 334 |
| 330 bool has_scheduled_tile_tasks_; | 335 bool has_scheduled_tile_tasks_; |
| 331 | 336 |
| 332 uint64_t prepare_tiles_count_; | 337 uint64_t prepare_tiles_count_; |
| 333 uint64_t next_tile_id_; | 338 uint64_t next_tile_id_; |
| 334 | 339 |
| 340 base::hash_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
| 341 |
| 335 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
| 336 | 343 |
| 337 DISALLOW_COPY_AND_ASSIGN(TileManager); | 344 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 338 }; | 345 }; |
| 339 | 346 |
| 340 } // namespace cc | 347 } // namespace cc |
| 341 | 348 |
| 342 #endif // CC_TILES_TILE_MANAGER_H_ | 349 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |