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