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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 Tile* tile = tiles[i]; | 149 Tile* tile = tiles[i]; |
150 FreeResourcesForTile(tile); | 150 FreeResourcesForTile(tile); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 void SetGlobalStateForTesting( | 154 void SetGlobalStateForTesting( |
155 const GlobalStateThatImpactsTilePriority& state) { | 155 const GlobalStateThatImpactsTilePriority& state) { |
156 global_state_ = state; | 156 global_state_ = state; |
157 } | 157 } |
158 | 158 |
159 TileTaskRunner* TileTaskRunnerForTesting() const { return tile_task_runner_; } | |
160 | |
159 void SetTileTaskRunnerForTesting(TileTaskRunner* tile_task_runner); | 161 void SetTileTaskRunnerForTesting(TileTaskRunner* tile_task_runner); |
160 | 162 |
161 void FreeResourcesAndCleanUpReleasedTilesForTesting() { | 163 void FreeResourcesAndCleanUpReleasedTilesForTesting() { |
162 FreeResourcesForReleasedTiles(); | 164 FreeResourcesForReleasedTiles(); |
163 CleanUpReleasedTiles(); | 165 CleanUpReleasedTiles(); |
164 } | 166 } |
165 | 167 |
166 std::vector<Tile*> AllTilesForTesting() const { | 168 std::vector<Tile*> AllTilesForTesting() const { |
167 std::vector<Tile*> tiles; | 169 std::vector<Tile*> tiles; |
168 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); | 170 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); |
169 ++it) { | 171 ++it) { |
170 tiles.push_back(it->second); | 172 tiles.push_back(it->second); |
171 } | 173 } |
172 return tiles; | 174 return tiles; |
173 } | 175 } |
174 | 176 |
175 void SetScheduledRasterTaskLimitForTesting(size_t limit) { | 177 void SetScheduledRasterTaskLimitForTesting(size_t limit) { |
176 scheduled_raster_task_limit_ = limit; | 178 scheduled_raster_task_limit_ = limit; |
177 } | 179 } |
178 | 180 |
181 void CheckIfMoreTilesNeedToBePreparedForTesting(); | |
182 | |
179 bool IsReadyToActivate() const; | 183 bool IsReadyToActivate() const; |
vmpstr
2015/03/27 17:23:28
While here, can you move these to be above the for
sunnyps
2015/03/27 18:38:04
Done.
| |
180 bool IsReadyToDraw() const; | 184 bool IsReadyToDraw() const; |
181 | 185 |
182 protected: | 186 protected: |
183 TileManager(TileManagerClient* client, | 187 TileManager(TileManagerClient* client, |
184 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 188 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
185 ResourcePool* resource_pool, | 189 ResourcePool* resource_pool, |
186 TileTaskRunner* tile_task_runner, | 190 TileTaskRunner* tile_task_runner, |
187 Rasterizer* rasterizer, | 191 Rasterizer* rasterizer, |
188 size_t scheduled_raster_task_limit); | 192 size_t scheduled_raster_task_limit); |
189 | 193 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 315 |
312 bool did_notify_ready_to_activate_; | 316 bool did_notify_ready_to_activate_; |
313 bool did_notify_ready_to_draw_; | 317 bool did_notify_ready_to_draw_; |
314 | 318 |
315 DISALLOW_COPY_AND_ASSIGN(TileManager); | 319 DISALLOW_COPY_AND_ASSIGN(TileManager); |
316 }; | 320 }; |
317 | 321 |
318 } // namespace cc | 322 } // namespace cc |
319 | 323 |
320 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 324 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |