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_TILE_MANAGER_H_ | 5 #ifndef CC_TILE_MANAGER_H_ |
6 #define CC_TILE_MANAGER_H_ | 6 #define CC_TILE_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 virtual ~TileManager(); | 112 virtual ~TileManager(); |
113 | 113 |
114 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 114 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
115 return global_state_; | 115 return global_state_; |
116 } | 116 } |
117 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 117 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
118 | 118 |
119 void ManageTiles(); | 119 void ManageTiles(); |
120 void CheckForCompletedTileUploads(); | 120 void CheckForCompletedTileUploads(); |
121 void AbortPendingTileUploads(); | 121 void AbortPendingTileUploads(); |
| 122 void DidCompleteFrame(); |
122 | 123 |
123 scoped_ptr<base::Value> BasicStateAsValue() const; | 124 scoped_ptr<base::Value> BasicStateAsValue() const; |
124 scoped_ptr<base::Value> AllTilesAsValue() const; | 125 scoped_ptr<base::Value> AllTilesAsValue() const; |
125 void GetMemoryStats(size_t* memoryRequiredBytes, | 126 void GetMemoryStats(size_t* memoryRequiredBytes, |
126 size_t* memoryNiceToHaveBytes, | 127 size_t* memoryNiceToHaveBytes, |
127 size_t* memoryUsedBytes) const; | 128 size_t* memoryUsedBytes) const; |
128 void SetRecordRenderingStats(bool record_rendering_stats); | 129 void SetRecordRenderingStats(bool record_rendering_stats); |
129 void GetRenderingStats(RenderingStats* stats); | 130 void GetRenderingStats(RenderingStats* stats); |
130 bool HasPendingWorkScheduled(WhichTree tree) const; | 131 bool HasPendingWorkScheduled(WhichTree tree) const; |
131 | 132 |
(...skipping 27 matching lines...) Expand all Loading... |
159 manage_tiles_pending_ = true; | 160 manage_tiles_pending_ = true; |
160 } | 161 } |
161 void DispatchMoreTasks(); | 162 void DispatchMoreTasks(); |
162 void GatherPixelRefsForTile(Tile* tile); | 163 void GatherPixelRefsForTile(Tile* tile); |
163 void DispatchImageDecodeTasksForTile(Tile* tile); | 164 void DispatchImageDecodeTasksForTile(Tile* tile); |
164 void DispatchOneImageDecodeTask( | 165 void DispatchOneImageDecodeTask( |
165 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); | 166 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); |
166 void OnImageDecodeTaskCompleted( | 167 void OnImageDecodeTaskCompleted( |
167 scoped_refptr<Tile> tile, | 168 scoped_refptr<Tile> tile, |
168 uint32_t pixel_ref_id); | 169 uint32_t pixel_ref_id); |
169 bool CanDispatchRasterTask(Tile* tile); | 170 bool CanDispatchRasterTask(Tile* tile) const; |
170 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); | 171 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); |
171 void DispatchOneRasterTask(scoped_refptr<Tile> tile); | 172 void DispatchOneRasterTask(scoped_refptr<Tile> tile); |
172 void PerformOneRaster(Tile* tile); | |
173 void OnRasterCompleted( | 173 void OnRasterCompleted( |
174 scoped_refptr<Tile> tile, | 174 scoped_refptr<Tile> tile, |
175 scoped_ptr<ResourcePool::Resource> resource, | 175 scoped_ptr<ResourcePool::Resource> resource, |
176 int manage_tiles_call_count_when_dispatched); | 176 int manage_tiles_call_count_when_dispatched); |
177 void OnRasterTaskCompleted( | 177 void OnRasterTaskCompleted( |
178 scoped_refptr<Tile> tile, | 178 scoped_refptr<Tile> tile, |
179 scoped_ptr<ResourcePool::Resource> resource, | 179 scoped_ptr<ResourcePool::Resource> resource, |
180 int manage_tiles_call_count_when_dispatched); | 180 int manage_tiles_call_count_when_dispatched); |
181 void DidFinishTileInitialization(Tile* tile); | 181 void DidFinishTileInitialization(Tile* tile); |
182 void DidTileRasterStateChange(Tile* tile, TileRasterState state); | 182 void DidTileRasterStateChange(Tile* tile, TileRasterState state); |
183 void DidTileTreeBinChange(Tile* tile, | 183 void DidTileTreeBinChange(Tile* tile, |
184 TileManagerBin new_tree_bin, | 184 TileManagerBin new_tree_bin, |
185 WhichTree tree); | 185 WhichTree tree); |
186 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; | 186 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; |
187 | 187 |
188 static void PerformRaster(uint8* buffer, | 188 static void PerformRaster(uint8* buffer, |
189 const gfx::Rect& rect, | 189 const gfx::Rect& rect, |
190 float contents_scale, | 190 float contents_scale, |
191 bool use_cheapness_estimator, | 191 bool use_cheapness_estimator, |
192 const RasterTaskMetadata& raster_task_metadata, | 192 const RasterTaskMetadata& raster_task_metadata, |
193 PicturePileImpl* picture_pile, | 193 PicturePileImpl* picture_pile, |
194 RenderingStats* stats); | 194 RenderingStats* stats); |
195 static void RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, | 195 static void PerformImageDecode(skia::LazyPixelRef* pixel_ref, |
196 RenderingStats* stats); | 196 RenderingStats* stats); |
197 | 197 |
198 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, | 198 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, |
199 bool is_actually_cheap); | 199 bool is_actually_cheap); |
200 | 200 |
201 TileManagerClient* client_; | 201 TileManagerClient* client_; |
202 scoped_ptr<ResourcePool> resource_pool_; | 202 scoped_ptr<ResourcePool> resource_pool_; |
203 scoped_ptr<RasterWorkerPool> raster_worker_pool_; | 203 scoped_ptr<RasterWorkerPool> raster_worker_pool_; |
204 bool manage_tiles_pending_; | 204 bool manage_tiles_pending_; |
205 int manage_tiles_call_count_; | 205 int manage_tiles_call_count_; |
(...skipping 18 matching lines...) Expand all Loading... |
224 TileQueue tiles_with_pending_set_pixels_; | 224 TileQueue tiles_with_pending_set_pixels_; |
225 size_t bytes_pending_set_pixels_; | 225 size_t bytes_pending_set_pixels_; |
226 bool has_performed_uploads_since_last_flush_; | 226 bool has_performed_uploads_since_last_flush_; |
227 bool ever_exceeded_memory_budget_; | 227 bool ever_exceeded_memory_budget_; |
228 MemoryHistory::Entry memory_stats_from_last_assign_; | 228 MemoryHistory::Entry memory_stats_from_last_assign_; |
229 | 229 |
230 bool record_rendering_stats_; | 230 bool record_rendering_stats_; |
231 RenderingStats rendering_stats_; | 231 RenderingStats rendering_stats_; |
232 | 232 |
233 bool use_cheapness_estimator_; | 233 bool use_cheapness_estimator_; |
| 234 bool did_schedule_cheap_tasks_; |
| 235 bool allow_cheap_tasks_; |
234 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 236 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
235 | 237 |
236 DISALLOW_COPY_AND_ASSIGN(TileManager); | 238 DISALLOW_COPY_AND_ASSIGN(TileManager); |
237 }; | 239 }; |
238 | 240 |
239 } // namespace cc | 241 } // namespace cc |
240 | 242 |
241 #endif // CC_TILE_MANAGER_H_ | 243 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |