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 <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 inline size_t BytesConsumedIfAllocated(const Tile* tile) const { | 170 inline size_t BytesConsumedIfAllocated(const Tile* tile) const { |
171 return Resource::MemorySizeBytes(tile->size(), | 171 return Resource::MemorySizeBytes(tile->size(), |
172 raster_worker_pool_->GetResourceFormat()); | 172 raster_worker_pool_->GetResourceFormat()); |
173 } | 173 } |
174 | 174 |
175 RasterMode DetermineRasterMode(const Tile* tile) const; | 175 RasterMode DetermineRasterMode(const Tile* tile) const; |
176 void FreeResourceForTile(Tile* tile, RasterMode mode); | 176 void FreeResourceForTile(Tile* tile, RasterMode mode); |
177 void FreeResourcesForTile(Tile* tile); | 177 void FreeResourcesForTile(Tile* tile); |
178 void FreeUnusedResourcesForTile(Tile* tile); | 178 void FreeUnusedResourcesForTile(Tile* tile); |
179 RasterWorkerPool::Task CreateImageDecodeTask(Tile* tile, | 179 scoped_refptr<internal::WorkerPoolTask> CreateImageDecodeTask( |
180 SkPixelRef* pixel_ref); | 180 Tile* tile, |
181 RasterWorkerPool::RasterTask CreateRasterTask(Tile* tile); | 181 SkPixelRef* pixel_ref); |
| 182 scoped_refptr<internal::RasterWorkerPoolTask> CreateRasterTask(Tile* tile); |
182 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; | 183 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; |
183 void UpdatePrioritizedTileSetIfNeeded(); | 184 void UpdatePrioritizedTileSetIfNeeded(); |
184 | 185 |
185 TileManagerClient* client_; | 186 TileManagerClient* client_; |
186 ContextProvider* context_provider_; | 187 ContextProvider* context_provider_; |
187 scoped_ptr<ResourcePool> resource_pool_; | 188 scoped_ptr<ResourcePool> resource_pool_; |
188 scoped_ptr<RasterWorkerPool> raster_worker_pool_; | 189 scoped_ptr<RasterWorkerPool> raster_worker_pool_; |
189 scoped_ptr<RasterWorkerPool> direct_raster_worker_pool_; | 190 scoped_ptr<RasterWorkerPool> direct_raster_worker_pool_; |
190 scoped_ptr<RasterWorkerPoolDelegate> raster_worker_pool_delegate_; | 191 scoped_ptr<RasterWorkerPoolDelegate> raster_worker_pool_delegate_; |
191 GlobalStateThatImpactsTilePriority global_state_; | 192 GlobalStateThatImpactsTilePriority global_state_; |
(...skipping 15 matching lines...) Expand all Loading... |
207 size_t max_raster_usage_bytes_; | 208 size_t max_raster_usage_bytes_; |
208 | 209 |
209 bool ever_exceeded_memory_budget_; | 210 bool ever_exceeded_memory_budget_; |
210 MemoryHistory::Entry memory_stats_from_last_assign_; | 211 MemoryHistory::Entry memory_stats_from_last_assign_; |
211 | 212 |
212 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 213 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
213 | 214 |
214 bool did_initialize_visible_tile_; | 215 bool did_initialize_visible_tile_; |
215 bool did_check_for_completed_tasks_since_last_schedule_tasks_; | 216 bool did_check_for_completed_tasks_since_last_schedule_tasks_; |
216 | 217 |
217 typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefTaskMap; | 218 typedef base::hash_map<uint32_t, scoped_refptr<internal::WorkerPoolTask> > |
| 219 PixelRefTaskMap; |
218 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; | 220 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; |
219 LayerPixelRefTaskMap image_decode_tasks_; | 221 LayerPixelRefTaskMap image_decode_tasks_; |
220 | 222 |
221 typedef base::hash_map<int, int> LayerCountMap; | 223 typedef base::hash_map<int, int> LayerCountMap; |
222 LayerCountMap used_layer_counts_; | 224 LayerCountMap used_layer_counts_; |
223 | 225 |
224 RasterTaskCompletionStats update_visible_tiles_stats_; | 226 RasterTaskCompletionStats update_visible_tiles_stats_; |
225 | 227 |
226 std::vector<Tile*> released_tiles_; | 228 std::vector<Tile*> released_tiles_; |
227 | 229 |
228 bool use_rasterize_on_demand_; | 230 bool use_rasterize_on_demand_; |
229 | 231 |
230 // Queues used when scheduling raster tasks. | 232 // Queues used when scheduling raster tasks. |
231 RasterWorkerPool::RasterTask::Queue | 233 RasterTaskQueue raster_queue_[NUM_RASTER_WORKER_POOL_TYPES]; |
232 raster_queue_[NUM_RASTER_WORKER_POOL_TYPES]; | |
233 | 234 |
234 DISALLOW_COPY_AND_ASSIGN(TileManager); | 235 DISALLOW_COPY_AND_ASSIGN(TileManager); |
235 }; | 236 }; |
236 | 237 |
237 } // namespace cc | 238 } // namespace cc |
238 | 239 |
239 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 240 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |