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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 void SetGlobalStateForTesting( | 213 void SetGlobalStateForTesting( |
214 const GlobalStateThatImpactsTilePriority& state) { | 214 const GlobalStateThatImpactsTilePriority& state) { |
215 // Soft limit is used for resource pool such that | 215 // Soft limit is used for resource pool such that |
216 // memory returns to soft limit after going over. | 216 // memory returns to soft limit after going over. |
217 if (state != global_state_) { | 217 if (state != global_state_) { |
218 global_state_ = state; | 218 global_state_ = state; |
219 prioritized_tiles_dirty_ = true; | 219 prioritized_tiles_dirty_ = true; |
220 resource_pool_->SetResourceUsageLimits( | |
221 global_state_.soft_memory_limit_in_bytes, | |
222 global_state_.unused_memory_limit_in_bytes, | |
223 global_state_.num_resources_limit); | |
224 } | 220 } |
225 } | 221 } |
226 | 222 |
227 protected: | 223 protected: |
228 TileManager(TileManagerClient* client, | 224 TileManager(TileManagerClient* client, |
229 ResourcePool* resource_pool, | 225 ResourcePool* resource_pool, |
230 Rasterizer* rasterizer, | 226 Rasterizer* rasterizer, |
231 Rasterizer* gpu_rasterizer, | 227 Rasterizer* gpu_rasterizer, |
232 size_t max_raster_usage_bytes, | 228 size_t max_raster_usage_bytes, |
233 bool use_rasterize_on_demand, | 229 bool use_rasterize_on_demand, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 335 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
340 | 336 |
341 std::vector<PictureLayerImpl*> layers_; | 337 std::vector<PictureLayerImpl*> layers_; |
342 | 338 |
343 DISALLOW_COPY_AND_ASSIGN(TileManager); | 339 DISALLOW_COPY_AND_ASSIGN(TileManager); |
344 }; | 340 }; |
345 | 341 |
346 } // namespace cc | 342 } // namespace cc |
347 | 343 |
348 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 344 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |