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_ = resource_pool_->AcquireResource(gfx::Size(1, 1)); | 126 tile_version.resource_ = |
127 resource_pool_->AcquireResource(tiles[i]->tile_size_.size()); | |
danakj
2014/08/13 21:48:26
tile_size_ is a Rect... weird. theres tiles[i]->si
| |
127 | 128 |
128 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]); | 129 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]); |
129 ++resources_releasable_; | 130 ++resources_releasable_; |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
133 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { | 134 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { |
134 for (size_t i = 0; i < tiles.size(); ++i) { | 135 for (size_t i = 0; i < tiles.size(); ++i) { |
135 Tile* tile = tiles[i]; | 136 Tile* tile = tiles[i]; |
136 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 137 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 264 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
264 | 265 |
265 UniqueNotifier ready_to_activate_check_notifier_; | 266 UniqueNotifier ready_to_activate_check_notifier_; |
266 | 267 |
267 DISALLOW_COPY_AND_ASSIGN(TileManager); | 268 DISALLOW_COPY_AND_ASSIGN(TileManager); |
268 }; | 269 }; |
269 | 270 |
270 } // namespace cc | 271 } // namespace cc |
271 | 272 |
272 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 273 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |