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 <vector> | 10 #include <vector> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void OnRasterCompleted( | 159 void OnRasterCompleted( |
160 scoped_refptr<Tile> tile, | 160 scoped_refptr<Tile> tile, |
161 scoped_ptr<ResourcePool::Resource> resource, | 161 scoped_ptr<ResourcePool::Resource> resource, |
162 int manage_tiles_call_count_when_dispatched); | 162 int manage_tiles_call_count_when_dispatched); |
163 void OnRasterTaskCompleted( | 163 void OnRasterTaskCompleted( |
164 scoped_refptr<Tile> tile, | 164 scoped_refptr<Tile> tile, |
165 scoped_ptr<ResourcePool::Resource> resource, | 165 scoped_ptr<ResourcePool::Resource> resource, |
166 int manage_tiles_call_count_when_dispatched); | 166 int manage_tiles_call_count_when_dispatched); |
167 void DidFinishTileInitialization(Tile* tile); | 167 void DidFinishTileInitialization(Tile* tile); |
168 void DidTileRasterStateChange(Tile* tile, TileRasterState state); | 168 void DidTileRasterStateChange(Tile* tile, TileRasterState state); |
169 void DidTileBinChange(Tile* tile, | 169 void DidTileTreeBinChange(Tile* tile, |
170 TileManagerBin bin, | 170 TileManagerBin new_tree_bin, |
171 WhichTree tree); | 171 WhichTree tree); |
172 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; | 172 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; |
173 | 173 |
174 static void PerformRaster(uint8* buffer, | 174 static void PerformRaster(uint8* buffer, |
175 const gfx::Rect& rect, | 175 const gfx::Rect& rect, |
176 float contents_scale, | 176 float contents_scale, |
177 bool use_cheapness_estimator, | 177 bool use_cheapness_estimator, |
178 PicturePileImpl* picture_pile, | 178 PicturePileImpl* picture_pile, |
179 RenderingStats* stats); | 179 RenderingStats* stats); |
180 static void RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, | 180 static void RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, |
181 RenderingStats* stats); | 181 RenderingStats* stats); |
182 | 182 |
183 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, | 183 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, |
184 bool is_actually_cheap); | 184 bool is_actually_cheap); |
185 | 185 |
186 TileManagerClient* client_; | 186 TileManagerClient* client_; |
187 scoped_ptr<ResourcePool> resource_pool_; | 187 scoped_ptr<ResourcePool> resource_pool_; |
188 scoped_ptr<RasterWorkerPool> raster_worker_pool_; | 188 scoped_ptr<RasterWorkerPool> raster_worker_pool_; |
189 bool manage_tiles_pending_; | 189 bool manage_tiles_pending_; |
190 int manage_tiles_call_count_; | 190 int manage_tiles_call_count_; |
191 | 191 |
192 GlobalStateThatImpactsTilePriority global_state_; | 192 GlobalStateThatImpactsTilePriority global_state_; |
193 | 193 |
194 typedef std::vector<Tile*> TileVector; | 194 typedef std::vector<Tile*> TileVector; |
195 TileVector tiles_; | 195 TileVector all_tiles_; |
| 196 TileVector live_or_allocated_tiles_; |
196 TileVector tiles_that_need_to_be_rasterized_; | 197 TileVector tiles_that_need_to_be_rasterized_; |
197 | 198 |
198 typedef std::list<Tile*> TileList; | 199 typedef std::list<Tile*> TileList; |
199 // Tiles with image decoding tasks. These tiles need to be rasterized | 200 // Tiles with image decoding tasks. These tiles need to be rasterized |
200 // when all the image decoding tasks finish. | 201 // when all the image decoding tasks finish. |
201 TileList tiles_with_image_decoding_tasks_; | 202 TileList tiles_with_image_decoding_tasks_; |
202 | 203 |
203 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; | 204 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; |
204 PixelRefMap pending_decode_tasks_; | 205 PixelRefMap pending_decode_tasks_; |
205 | 206 |
206 typedef std::queue<scoped_refptr<Tile> > TileQueue; | 207 typedef std::queue<scoped_refptr<Tile> > TileQueue; |
207 TileQueue tiles_with_pending_set_pixels_; | 208 TileQueue tiles_with_pending_set_pixels_; |
208 size_t bytes_pending_set_pixels_; | 209 size_t bytes_pending_set_pixels_; |
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 bool record_rendering_stats_; | 213 bool record_rendering_stats_; |
213 RenderingStats rendering_stats_; | 214 RenderingStats rendering_stats_; |
214 | 215 |
215 bool use_cheapness_estimator_; | 216 bool use_cheapness_estimator_; |
216 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 217 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
217 | 218 |
218 DISALLOW_COPY_AND_ASSIGN(TileManager); | 219 DISALLOW_COPY_AND_ASSIGN(TileManager); |
219 }; | 220 }; |
220 | 221 |
221 } // namespace cc | 222 } // namespace cc |
222 | 223 |
223 #endif // CC_TILE_MANAGER_H_ | 224 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |