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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 MemoryUsage operator-(const MemoryUsage& other); | 234 MemoryUsage operator-(const MemoryUsage& other); |
235 | 235 |
236 bool Exceeds(const MemoryUsage& limit) const; | 236 bool Exceeds(const MemoryUsage& limit) const; |
237 int64_t memory_bytes() const { return memory_bytes_; } | 237 int64_t memory_bytes() const { return memory_bytes_; } |
238 | 238 |
239 private: | 239 private: |
240 int64_t memory_bytes_; | 240 int64_t memory_bytes_; |
241 int resource_count_; | 241 int resource_count_; |
242 }; | 242 }; |
243 | 243 |
244 void OnRasterTaskCompleted( | 244 void CheckForCompletedTasks(); |
245 Tile::Id tile, | 245 void CompleteRasterTask(Tile::Id tile_id, |
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<RasterTask> 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, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Task::Vector raster_tasks_; |
308 std::vector<scoped_refptr<TileTask>> orphan_tasks_; | 309 std::vector<scoped_refptr<TileTask>> orphan_tasks_; |
309 | 310 |
310 TaskGraph graph_; | 311 TaskGraph graph_; |
311 scoped_refptr<TileTask> required_for_activation_done_task_; | 312 scoped_refptr<TileTask> required_for_activation_done_task_; |
312 scoped_refptr<TileTask> required_for_draw_done_task_; | 313 scoped_refptr<TileTask> required_for_draw_done_task_; |
313 scoped_refptr<TileTask> all_done_task_; | 314 scoped_refptr<TileTask> all_done_task_; |
314 | 315 |
315 UniqueNotifier more_tiles_need_prepare_check_notifier_; | 316 UniqueNotifier more_tiles_need_prepare_check_notifier_; |
316 | 317 |
317 struct Signals { | 318 struct Signals { |
(...skipping 19 matching lines...) Expand all Loading... |
337 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; | 338 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
338 | 339 |
339 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 340 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
340 | 341 |
341 DISALLOW_COPY_AND_ASSIGN(TileManager); | 342 DISALLOW_COPY_AND_ASSIGN(TileManager); |
342 }; | 343 }; |
343 | 344 |
344 } // namespace cc | 345 } // namespace cc |
345 | 346 |
346 #endif // CC_TILES_TILE_MANAGER_H_ | 347 #endif // CC_TILES_TILE_MANAGER_H_ |
OLD | NEW |