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_RESOURCES_TILE_MANAGER_H_ | 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_ |
6 #define CC_RESOURCES_TILE_MANAGER_H_ | 6 #define CC_RESOURCES_TILE_MANAGER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // should no longer have any memory assigned to them. Tile objects are "owned" | 60 // should no longer have any memory assigned to them. Tile objects are "owned" |
61 // by layers; they automatically register with the manager when they are | 61 // by layers; they automatically register with the manager when they are |
62 // created, and unregister from the manager when they are deleted. | 62 // created, and unregister from the manager when they are deleted. |
63 class CC_EXPORT TileManager : public WorkerPoolClient { | 63 class CC_EXPORT TileManager : public WorkerPoolClient { |
64 public: | 64 public: |
65 static scoped_ptr<TileManager> Create( | 65 static scoped_ptr<TileManager> Create( |
66 TileManagerClient* client, | 66 TileManagerClient* client, |
67 ResourceProvider* resource_provider, | 67 ResourceProvider* resource_provider, |
68 size_t num_raster_threads, | 68 size_t num_raster_threads, |
69 bool use_color_estimator, | 69 bool use_color_estimator, |
70 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 70 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
71 | 71 bool use_map_image); |
72 virtual ~TileManager(); | 72 virtual ~TileManager(); |
73 | 73 |
74 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 74 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
75 return global_state_; | 75 return global_state_; |
76 } | 76 } |
77 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 77 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
78 | 78 |
79 void ManageTiles(); | 79 void ManageTiles(); |
80 void CheckForCompletedTileUploads(); | 80 void CheckForCompletedTileUploads(); |
81 void AbortPendingTileUploads(); | 81 void AbortPendingTileUploads(); |
(...skipping 18 matching lines...) Expand all Loading... |
100 bool AreTilesRequiredForActivationReady() const { | 100 bool AreTilesRequiredForActivationReady() const { |
101 return tiles_that_need_to_be_initialized_for_activation_.empty(); | 101 return tiles_that_need_to_be_initialized_for_activation_.empty(); |
102 } | 102 } |
103 | 103 |
104 protected: | 104 protected: |
105 TileManager(TileManagerClient* client, | 105 TileManager(TileManagerClient* client, |
106 ResourceProvider* resource_provider, | 106 ResourceProvider* resource_provider, |
107 scoped_ptr<RasterWorkerPool> raster_worker_pool, | 107 scoped_ptr<RasterWorkerPool> raster_worker_pool, |
108 size_t num_raster_threads, | 108 size_t num_raster_threads, |
109 bool use_color_estimator, | 109 bool use_color_estimator, |
110 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 110 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 111 bool use_map_image); |
111 | 112 |
112 // Methods called by Tile | 113 // Methods called by Tile |
113 friend class Tile; | 114 friend class Tile; |
114 void RegisterTile(Tile* tile); | 115 void RegisterTile(Tile* tile); |
115 void UnregisterTile(Tile* tile); | 116 void UnregisterTile(Tile* tile); |
116 | 117 |
117 // Virtual for test | 118 // Virtual for test |
118 virtual void DispatchMoreTasks(); | 119 virtual void DispatchMoreTasks(); |
119 | 120 |
120 private: | 121 private: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 219 |
219 size_t pending_tasks_; | 220 size_t pending_tasks_; |
220 size_t max_pending_tasks_; | 221 size_t max_pending_tasks_; |
221 | 222 |
222 DISALLOW_COPY_AND_ASSIGN(TileManager); | 223 DISALLOW_COPY_AND_ASSIGN(TileManager); |
223 }; | 224 }; |
224 | 225 |
225 } // namespace cc | 226 } // namespace cc |
226 | 227 |
227 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 228 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |