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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 MemoryUsage operator-(const MemoryUsage& other); | 237 MemoryUsage operator-(const MemoryUsage& other); |
238 | 238 |
239 bool Exceeds(const MemoryUsage& limit) const; | 239 bool Exceeds(const MemoryUsage& limit) const; |
240 int64_t memory_bytes() const { return memory_bytes_; } | 240 int64_t memory_bytes() const { return memory_bytes_; } |
241 | 241 |
242 private: | 242 private: |
243 int64_t memory_bytes_; | 243 int64_t memory_bytes_; |
244 int resource_count_; | 244 int resource_count_; |
245 }; | 245 }; |
246 | 246 |
247 void OnRasterTaskCompleted( | 247 void CheckForCompletedTasks(); |
248 Tile::Id tile, | 248 void OnRasterTaskCompleted(TileTask* task); |
249 Resource* resource, | |
250 bool was_canceled); | |
251 | 249 |
252 void FreeResourcesForTile(Tile* tile); | 250 void FreeResourcesForTile(Tile* tile); |
253 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); | 251 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); |
254 scoped_refptr<TileTask> CreateRasterTask( | 252 scoped_refptr<TileTask> CreateRasterTask( |
255 const PrioritizedTile& prioritized_tile); | 253 const PrioritizedTile& prioritized_tile); |
256 | 254 |
257 std::unique_ptr<EvictionTilePriorityQueue> | 255 std::unique_ptr<EvictionTilePriorityQueue> |
258 FreeTileResourcesUntilUsageIsWithinLimit( | 256 FreeTileResourcesUntilUsageIsWithinLimit( |
259 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, | 257 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, |
260 const MemoryUsage& limit, | 258 const MemoryUsage& limit, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; | 339 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
342 | 340 |
343 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 341 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
344 | 342 |
345 DISALLOW_COPY_AND_ASSIGN(TileManager); | 343 DISALLOW_COPY_AND_ASSIGN(TileManager); |
346 }; | 344 }; |
347 | 345 |
348 } // namespace cc | 346 } // namespace cc |
349 | 347 |
350 #endif // CC_TILES_TILE_MANAGER_H_ | 348 #endif // CC_TILES_TILE_MANAGER_H_ |
OLD | NEW |