| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // This class manages tiles, deciding which should get rasterized and which | 89 // This class manages tiles, deciding which should get rasterized and which |
| 90 // should no longer have any memory assigned to them. Tile objects are "owned" | 90 // should no longer have any memory assigned to them. Tile objects are "owned" |
| 91 // by layers; they automatically register with the manager when they are | 91 // by layers; they automatically register with the manager when they are |
| 92 // created, and unregister from the manager when they are deleted. | 92 // created, and unregister from the manager when they are deleted. |
| 93 class CC_EXPORT TileManager { | 93 class CC_EXPORT TileManager { |
| 94 public: | 94 public: |
| 95 TileManager(TileManagerClient* client, | 95 TileManager(TileManagerClient* client, |
| 96 ResourceProvider *resource_provider, | 96 ResourceProvider *resource_provider, |
| 97 size_t num_raster_threads, | 97 size_t num_raster_threads); |
| 98 bool record_rendering_stats); | |
| 99 virtual ~TileManager(); | 98 virtual ~TileManager(); |
| 100 | 99 |
| 101 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 100 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
| 102 return global_state_; | 101 return global_state_; |
| 103 } | 102 } |
| 104 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 103 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
| 105 | 104 |
| 106 void ManageTiles(); | 105 void ManageTiles(); |
| 107 void CheckForCompletedTileUploads(); | 106 void CheckForCompletedTileUploads(); |
| 108 | 107 |
| 109 scoped_ptr<base::Value> AsValue() const; | 108 scoped_ptr<base::Value> AsValue() const; |
| 110 void GetMemoryStats(size_t* memoryRequiredBytes, | 109 void GetMemoryStats(size_t* memoryRequiredBytes, |
| 111 size_t* memoryNiceToHaveBytes, | 110 size_t* memoryNiceToHaveBytes, |
| 112 size_t* memoryUsedBytes) const; | 111 size_t* memoryUsedBytes) const; |
| 112 void SetRecordRenderingStats(bool); |
| 113 void GetRenderingStats(RenderingStats* stats); | 113 void GetRenderingStats(RenderingStats* stats); |
| 114 bool HasPendingWorkScheduled(WhichTree tree) const; | 114 bool HasPendingWorkScheduled(WhichTree tree) const; |
| 115 | 115 |
| 116 const MemoryHistory::Entry& memory_stats_from_last_assign() const { return mem
ory_stats_from_last_assign_; } | 116 const MemoryHistory::Entry& memory_stats_from_last_assign() const { return mem
ory_stats_from_last_assign_; } |
| 117 | 117 |
| 118 protected: | 118 protected: |
| 119 // Methods called by Tile | 119 // Methods called by Tile |
| 120 friend class Tile; | 120 friend class Tile; |
| 121 void RegisterTile(Tile* tile); | 121 void RegisterTile(Tile* tile); |
| 122 void UnregisterTile(Tile* tile); | 122 void UnregisterTile(Tile* tile); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 RenderingStats rendering_stats_; | 195 RenderingStats rendering_stats_; |
| 196 | 196 |
| 197 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 197 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
| 198 | 198 |
| 199 DISALLOW_COPY_AND_ASSIGN(TileManager); | 199 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 } // namespace cc | 202 } // namespace cc |
| 203 | 203 |
| 204 #endif // CC_TILE_MANAGER_H_ | 204 #endif // CC_TILE_MANAGER_H_ |
| OLD | NEW |