| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // This class manages tiles, deciding which should get rasterized and which | 88 // This class manages tiles, deciding which should get rasterized and which |
| 89 // should no longer have any memory assigned to them. Tile objects are "owned" | 89 // should no longer have any memory assigned to them. Tile objects are "owned" |
| 90 // by layers; they automatically register with the manager when they are | 90 // by layers; they automatically register with the manager when they are |
| 91 // created, and unregister from the manager when they are deleted. | 91 // created, and unregister from the manager when they are deleted. |
| 92 class CC_EXPORT TileManager { | 92 class CC_EXPORT TileManager { |
| 93 public: | 93 public: |
| 94 TileManager(TileManagerClient* client, | 94 TileManager(TileManagerClient* client, |
| 95 ResourceProvider *resource_provider, | 95 ResourceProvider *resource_provider, |
| 96 size_t num_raster_threads); | 96 size_t num_raster_threads, |
| 97 bool record_rendering_stats); |
| 97 virtual ~TileManager(); | 98 virtual ~TileManager(); |
| 98 | 99 |
| 99 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 100 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
| 100 return global_state_; | 101 return global_state_; |
| 101 } | 102 } |
| 102 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 103 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
| 103 | 104 |
| 104 void ManageTiles(); | 105 void ManageTiles(); |
| 105 void CheckForCompletedTileUploads(); | 106 void CheckForCompletedTileUploads(); |
| 106 | 107 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 TileList tiles_with_image_decoding_tasks_; | 171 TileList tiles_with_image_decoding_tasks_; |
| 171 | 172 |
| 172 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; | 173 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; |
| 173 PixelRefMap pending_decode_tasks_; | 174 PixelRefMap pending_decode_tasks_; |
| 174 | 175 |
| 175 typedef std::queue<scoped_refptr<Tile> > TileQueue; | 176 typedef std::queue<scoped_refptr<Tile> > TileQueue; |
| 176 TileQueue tiles_with_pending_set_pixels_; | 177 TileQueue tiles_with_pending_set_pixels_; |
| 177 size_t bytes_pending_set_pixels_; | 178 size_t bytes_pending_set_pixels_; |
| 178 bool ever_exceeded_memory_budget_; | 179 bool ever_exceeded_memory_budget_; |
| 179 | 180 |
| 181 bool record_rendering_stats_; |
| 180 RenderingStats rendering_stats_; | 182 RenderingStats rendering_stats_; |
| 181 | 183 |
| 182 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 184 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
| 183 | 185 |
| 184 DISALLOW_COPY_AND_ASSIGN(TileManager); | 186 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 185 }; | 187 }; |
| 186 | 188 |
| 187 } // namespace cc | 189 } // namespace cc |
| 188 | 190 |
| 189 #endif // CC_TILE_MANAGER_H_ | 191 #endif // CC_TILE_MANAGER_H_ |
| OLD | NEW |