| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 EvictionOrderComparator comparator_; | 151 EvictionOrderComparator comparator_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(EvictionTileIterator); | 153 DISALLOW_COPY_AND_ASSIGN(EvictionTileIterator); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 static scoped_ptr<TileManager> Create( | 156 static scoped_ptr<TileManager> Create( |
| 157 TileManagerClient* client, | 157 TileManagerClient* client, |
| 158 ResourcePool* resource_pool, | 158 ResourcePool* resource_pool, |
| 159 Rasterizer* rasterizer, | 159 Rasterizer* rasterizer, |
| 160 Rasterizer* gpu_rasterizer, | 160 Rasterizer* gpu_rasterizer, |
| 161 size_t max_raster_usage_bytes, | |
| 162 bool use_rasterize_on_demand, | 161 bool use_rasterize_on_demand, |
| 163 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 162 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 164 virtual ~TileManager(); | 163 virtual ~TileManager(); |
| 165 | 164 |
| 166 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); | 165 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); |
| 167 | 166 |
| 168 // Returns true when visible tiles have been initialized. | 167 // Returns true when visible tiles have been initialized. |
| 169 bool UpdateVisibleTiles(); | 168 bool UpdateVisibleTiles(); |
| 170 | 169 |
| 171 scoped_refptr<Tile> CreateTile(PicturePileImpl* picture_pile, | 170 scoped_refptr<Tile> CreateTile(PicturePileImpl* picture_pile, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 global_state_ = state; | 222 global_state_ = state; |
| 224 prioritized_tiles_dirty_ = true; | 223 prioritized_tiles_dirty_ = true; |
| 225 } | 224 } |
| 226 } | 225 } |
| 227 | 226 |
| 228 protected: | 227 protected: |
| 229 TileManager(TileManagerClient* client, | 228 TileManager(TileManagerClient* client, |
| 230 ResourcePool* resource_pool, | 229 ResourcePool* resource_pool, |
| 231 Rasterizer* rasterizer, | 230 Rasterizer* rasterizer, |
| 232 Rasterizer* gpu_rasterizer, | 231 Rasterizer* gpu_rasterizer, |
| 233 size_t max_raster_usage_bytes, | |
| 234 bool use_rasterize_on_demand, | 232 bool use_rasterize_on_demand, |
| 235 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 233 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 236 | 234 |
| 237 // Methods called by Tile | 235 // Methods called by Tile |
| 238 friend class Tile; | 236 friend class Tile; |
| 239 void DidChangeTilePriority(Tile* tile); | 237 void DidChangeTilePriority(Tile* tile); |
| 240 | 238 |
| 241 void CleanUpReleasedTiles(); | 239 void CleanUpReleasedTiles(); |
| 242 | 240 |
| 243 // Overriden from RefCountedManager<Tile>: | 241 // Overriden from RefCountedManager<Tile>: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 bool prioritized_tiles_dirty_; | 299 bool prioritized_tiles_dirty_; |
| 302 | 300 |
| 303 bool all_tiles_that_need_to_be_rasterized_have_memory_; | 301 bool all_tiles_that_need_to_be_rasterized_have_memory_; |
| 304 bool all_tiles_required_for_activation_have_memory_; | 302 bool all_tiles_required_for_activation_have_memory_; |
| 305 | 303 |
| 306 size_t memory_required_bytes_; | 304 size_t memory_required_bytes_; |
| 307 size_t memory_nice_to_have_bytes_; | 305 size_t memory_nice_to_have_bytes_; |
| 308 | 306 |
| 309 size_t bytes_releasable_; | 307 size_t bytes_releasable_; |
| 310 size_t resources_releasable_; | 308 size_t resources_releasable_; |
| 311 size_t max_raster_usage_bytes_; | |
| 312 | 309 |
| 313 bool ever_exceeded_memory_budget_; | 310 bool ever_exceeded_memory_budget_; |
| 314 MemoryHistory::Entry memory_stats_from_last_assign_; | 311 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 315 | 312 |
| 316 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 313 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 317 | 314 |
| 318 bool did_initialize_visible_tile_; | 315 bool did_initialize_visible_tile_; |
| 319 bool did_check_for_completed_tasks_since_last_schedule_tasks_; | 316 bool did_check_for_completed_tasks_since_last_schedule_tasks_; |
| 320 | 317 |
| 321 typedef base::hash_map<uint32_t, scoped_refptr<ImageDecodeTask> > | 318 typedef base::hash_map<uint32_t, scoped_refptr<ImageDecodeTask> > |
| (...skipping 18 matching lines...) Expand all Loading... |
| 340 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 337 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
| 341 | 338 |
| 342 std::vector<PictureLayerImpl*> layers_; | 339 std::vector<PictureLayerImpl*> layers_; |
| 343 | 340 |
| 344 DISALLOW_COPY_AND_ASSIGN(TileManager); | 341 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 345 }; | 342 }; |
| 346 | 343 |
| 347 } // namespace cc | 344 } // namespace cc |
| 348 | 345 |
| 349 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 346 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |