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 <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 scoped_refptr<base::debug::ConvertableToTraceFormat> | 80 scoped_refptr<base::debug::ConvertableToTraceFormat> |
81 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats); | 81 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats); |
82 | 82 |
83 // This class manages tiles, deciding which should get rasterized and which | 83 // This class manages tiles, deciding which should get rasterized and which |
84 // should no longer have any memory assigned to them. Tile objects are "owned" | 84 // should no longer have any memory assigned to them. Tile objects are "owned" |
85 // by layers; they automatically register with the manager when they are | 85 // by layers; they automatically register with the manager when they are |
86 // created, and unregister from the manager when they are deleted. | 86 // created, and unregister from the manager when they are deleted. |
87 class CC_EXPORT TileManager : public RasterizerClient, | 87 class CC_EXPORT TileManager : public RasterizerClient, |
88 public RefCountedManager<Tile> { | 88 public RefCountedManager<Tile> { |
89 public: | 89 public: |
90 enum NamedTaskSet { | |
91 HIGH_RESOLUTION_IN_NOW_BIN_ON_ACTIVE_TREE = 0, | |
reveman
2014/09/16 22:49:05
I think we should add this new task set in a follo
ernstm
2014/09/17 19:57:15
Done.
| |
92 REQUIRED_FOR_ACTIVATION = 1, | |
93 ALL = 2, | |
94 // Adding additional values requires increasing kNumberOfTaskSets in | |
95 // rasterizer.h | |
96 }; | |
97 | |
90 static scoped_ptr<TileManager> Create( | 98 static scoped_ptr<TileManager> Create( |
91 TileManagerClient* client, | 99 TileManagerClient* client, |
92 base::SequencedTaskRunner* task_runner, | 100 base::SequencedTaskRunner* task_runner, |
93 ResourcePool* resource_pool, | 101 ResourcePool* resource_pool, |
94 Rasterizer* rasterizer, | 102 Rasterizer* rasterizer, |
95 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 103 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
96 virtual ~TileManager(); | 104 virtual ~TileManager(); |
97 | 105 |
98 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); | 106 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); |
99 | 107 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 friend class Tile; | 176 friend class Tile; |
169 void DidChangeTilePriority(Tile* tile); | 177 void DidChangeTilePriority(Tile* tile); |
170 | 178 |
171 void FreeResourcesForReleasedTiles(); | 179 void FreeResourcesForReleasedTiles(); |
172 void CleanUpReleasedTiles(); | 180 void CleanUpReleasedTiles(); |
173 | 181 |
174 // Overriden from RefCountedManager<Tile>: | 182 // Overriden from RefCountedManager<Tile>: |
175 virtual void Release(Tile* tile) OVERRIDE; | 183 virtual void Release(Tile* tile) OVERRIDE; |
176 | 184 |
177 // Overriden from RasterizerClient: | 185 // Overriden from RasterizerClient: |
178 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; | 186 virtual void DidFinishRunningTasks(TaskSet task_set) OVERRIDE; |
179 virtual void DidFinishRunningTasks() OVERRIDE; | 187 virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const OVERRIDE; |
180 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; | |
181 | 188 |
182 typedef std::vector<Tile*> TileVector; | 189 typedef std::vector<Tile*> TileVector; |
183 typedef std::set<Tile*> TileSet; | 190 typedef std::set<Tile*> TileSet; |
184 | 191 |
185 // Virtual for test | 192 // Virtual for test |
186 virtual void ScheduleTasks( | 193 virtual void ScheduleTasks( |
187 const TileVector& tiles_that_need_to_be_rasterized); | 194 const TileVector& tiles_that_need_to_be_rasterized); |
188 | 195 |
189 void AssignGpuMemoryToTiles(PrioritizedTileSet* tiles, | 196 void AssignGpuMemoryToTiles(PrioritizedTileSet* tiles, |
190 TileVector* tiles_that_need_to_be_rasterized); | 197 TileVector* tiles_that_need_to_be_rasterized); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 271 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
265 | 272 |
266 UniqueNotifier ready_to_activate_check_notifier_; | 273 UniqueNotifier ready_to_activate_check_notifier_; |
267 | 274 |
268 DISALLOW_COPY_AND_ASSIGN(TileManager); | 275 DISALLOW_COPY_AND_ASSIGN(TileManager); |
269 }; | 276 }; |
270 | 277 |
271 } // namespace cc | 278 } // namespace cc |
272 | 279 |
273 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 280 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |