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