| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 NUM_BIN_PRIORITIES = 2 | 54 NUM_BIN_PRIORITIES = 2 |
| 55 }; | 55 }; |
| 56 scoped_ptr<base::Value> TileManagerBinPriorityAsValue( | 56 scoped_ptr<base::Value> TileManagerBinPriorityAsValue( |
| 57 TileManagerBinPriority bin); | 57 TileManagerBinPriority bin); |
| 58 | 58 |
| 59 enum TileRasterState { | 59 enum TileRasterState { |
| 60 IDLE_STATE = 0, | 60 IDLE_STATE = 0, |
| 61 WAITING_FOR_RASTER_STATE = 1, | 61 WAITING_FOR_RASTER_STATE = 1, |
| 62 RASTER_STATE = 2, | 62 RASTER_STATE = 2, |
| 63 UPLOAD_STATE = 3, | 63 UPLOAD_STATE = 3, |
| 64 NUM_STATES = 4 | 64 FORCED_UPLOAD_COMPLETION_STATE = 4, |
| 65 NUM_STATES = 5 |
| 65 }; | 66 }; |
| 66 scoped_ptr<base::Value> TileRasterStateAsValue( | 67 scoped_ptr<base::Value> TileRasterStateAsValue( |
| 67 TileRasterState bin); | 68 TileRasterState bin); |
| 68 | 69 |
| 69 // This class manages tiles, deciding which should get rasterized and which | 70 // This class manages tiles, deciding which should get rasterized and which |
| 70 // should no longer have any memory assigned to them. Tile objects are "owned" | 71 // should no longer have any memory assigned to them. Tile objects are "owned" |
| 71 // by layers; they automatically register with the manager when they are | 72 // by layers; they automatically register with the manager when they are |
| 72 // created, and unregister from the manager when they are deleted. | 73 // created, and unregister from the manager when they are deleted. |
| 73 class CC_EXPORT TileManager : public WorkerPoolClient { | 74 class CC_EXPORT TileManager : public WorkerPoolClient { |
| 74 public: | 75 public: |
| 75 TileManager(TileManagerClient* client, | 76 TileManager(TileManagerClient* client, |
| 76 ResourceProvider *resource_provider, | 77 ResourceProvider *resource_provider, |
| 77 size_t num_raster_threads, | 78 size_t num_raster_threads, |
| 78 bool use_cheapess_estimator, | 79 bool use_cheapess_estimator, |
| 79 bool use_color_estimator, | 80 bool use_color_estimator, |
| 80 bool prediction_benchmarking); | 81 bool prediction_benchmarking); |
| 81 virtual ~TileManager(); | 82 virtual ~TileManager(); |
| 82 | 83 |
| 83 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 84 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
| 84 return global_state_; | 85 return global_state_; |
| 85 } | 86 } |
| 86 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 87 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
| 87 | 88 |
| 88 void ManageTiles(); | 89 void ManageTiles(); |
| 89 void CheckForCompletedTileUploads(); | 90 void CheckForCompletedTileUploads(); |
| 90 void AbortPendingTileUploads(); | 91 void AbortPendingTileUploads(); |
| 92 void ForceTileUploadToComplete(Tile* tile); |
| 91 void DidCompleteFrame(); | 93 void DidCompleteFrame(); |
| 92 | 94 |
| 93 scoped_ptr<base::Value> BasicStateAsValue() const; | 95 scoped_ptr<base::Value> BasicStateAsValue() const; |
| 94 scoped_ptr<base::Value> AllTilesAsValue() const; | 96 scoped_ptr<base::Value> AllTilesAsValue() const; |
| 95 void GetMemoryStats(size_t* memoryRequiredBytes, | 97 void GetMemoryStats(size_t* memoryRequiredBytes, |
| 96 size_t* memoryNiceToHaveBytes, | 98 size_t* memoryNiceToHaveBytes, |
| 97 size_t* memoryUsedBytes) const; | 99 size_t* memoryUsedBytes) const; |
| 98 void SetRecordRenderingStats(bool record_rendering_stats); | 100 void SetRecordRenderingStats(bool record_rendering_stats); |
| 99 void GetRenderingStats(RenderingStats* stats); | 101 void GetRenderingStats(RenderingStats* stats); |
| 100 bool HasPendingWorkScheduled(WhichTree tree) const; | 102 bool HasPendingWorkScheduled(WhichTree tree) const; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 222 |
| 221 size_t pending_tasks_; | 223 size_t pending_tasks_; |
| 222 size_t max_pending_tasks_; | 224 size_t max_pending_tasks_; |
| 223 | 225 |
| 224 DISALLOW_COPY_AND_ASSIGN(TileManager); | 226 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 225 }; | 227 }; |
| 226 | 228 |
| 227 } // namespace cc | 229 } // namespace cc |
| 228 | 230 |
| 229 #endif // CC_TILE_MANAGER_H_ | 231 #endif // CC_TILE_MANAGER_H_ |
| OLD | NEW |