| 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_RESOURCES_TILE_MANAGER_H_ | 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_ |
| 6 #define CC_RESOURCES_TILE_MANAGER_H_ | 6 #define CC_RESOURCES_TILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const MemoryHistory::Entry& memory_stats_from_last_assign() const { | 116 const MemoryHistory::Entry& memory_stats_from_last_assign() const { |
| 117 return memory_stats_from_last_assign_; | 117 return memory_stats_from_last_assign_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 120 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 121 for (size_t i = 0; i < tiles.size(); ++i) { | 121 for (size_t i = 0; i < tiles.size(); ++i) { |
| 122 ManagedTileState& mts = tiles[i]->managed_state(); | 122 ManagedTileState& mts = tiles[i]->managed_state(); |
| 123 ManagedTileState::TileVersion& tile_version = | 123 ManagedTileState::TileVersion& tile_version = |
| 124 mts.tile_versions[HIGH_QUALITY_RASTER_MODE]; | 124 mts.tile_versions[HIGH_QUALITY_RASTER_MODE]; |
| 125 | 125 |
| 126 tile_version.resource_ = | 126 tile_version.resource_ = resource_pool_->AcquireResource(gfx::Size(1, 1)); |
| 127 resource_pool_->AcquireResource(tiles[i]->size()); | |
| 128 | 127 |
| 129 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]); | 128 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]); |
| 130 ++resources_releasable_; | 129 ++resources_releasable_; |
| 131 } | 130 } |
| 132 } | 131 } |
| 133 | 132 |
| 134 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { | 133 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 135 for (size_t i = 0; i < tiles.size(); ++i) { | 134 for (size_t i = 0; i < tiles.size(); ++i) { |
| 136 Tile* tile = tiles[i]; | 135 Tile* tile = tiles[i]; |
| 137 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 136 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 263 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
| 265 | 264 |
| 266 UniqueNotifier ready_to_activate_check_notifier_; | 265 UniqueNotifier ready_to_activate_check_notifier_; |
| 267 | 266 |
| 268 DISALLOW_COPY_AND_ASSIGN(TileManager); | 267 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 269 }; | 268 }; |
| 270 | 269 |
| 271 } // namespace cc | 270 } // namespace cc |
| 272 | 271 |
| 273 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 272 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |