Chromium Code Reviews| 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 REQUIRED_FOR_ACTIVATION = 0, | |
| 92 ALL = 1, | |
| 93 // Adding additional values requires increasing kNumberOfTaskSets in | |
| 94 // rasterizer.h | |
|
reveman
2014/09/17 20:46:28
Note: I think we might be able to use some templat
ernstm
2014/09/17 21:44:25
That would be great. Relaying on comments for such
| |
| 95 }; | |
| 96 | |
| 90 static scoped_ptr<TileManager> Create( | 97 static scoped_ptr<TileManager> Create( |
| 91 TileManagerClient* client, | 98 TileManagerClient* client, |
| 92 base::SequencedTaskRunner* task_runner, | 99 base::SequencedTaskRunner* task_runner, |
| 93 ResourcePool* resource_pool, | 100 ResourcePool* resource_pool, |
| 94 Rasterizer* rasterizer, | 101 Rasterizer* rasterizer, |
| 95 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 102 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 96 virtual ~TileManager(); | 103 virtual ~TileManager(); |
| 97 | 104 |
| 98 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); | 105 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); |
| 99 | 106 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 friend class Tile; | 175 friend class Tile; |
| 169 void DidChangeTilePriority(Tile* tile); | 176 void DidChangeTilePriority(Tile* tile); |
| 170 | 177 |
| 171 void FreeResourcesForReleasedTiles(); | 178 void FreeResourcesForReleasedTiles(); |
| 172 void CleanUpReleasedTiles(); | 179 void CleanUpReleasedTiles(); |
| 173 | 180 |
| 174 // Overriden from RefCountedManager<Tile>: | 181 // Overriden from RefCountedManager<Tile>: |
| 175 virtual void Release(Tile* tile) OVERRIDE; | 182 virtual void Release(Tile* tile) OVERRIDE; |
| 176 | 183 |
| 177 // Overriden from RasterizerClient: | 184 // Overriden from RasterizerClient: |
| 178 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; | 185 virtual void DidFinishRunningTasks(TaskSet task_set) OVERRIDE; |
| 179 virtual void DidFinishRunningTasks() OVERRIDE; | 186 virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const OVERRIDE; |
| 180 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; | |
| 181 | 187 |
| 182 typedef std::vector<Tile*> TileVector; | 188 typedef std::vector<Tile*> TileVector; |
| 183 typedef std::set<Tile*> TileSet; | 189 typedef std::set<Tile*> TileSet; |
| 184 | 190 |
| 185 // Virtual for test | 191 // Virtual for test |
| 186 virtual void ScheduleTasks( | 192 virtual void ScheduleTasks( |
| 187 const TileVector& tiles_that_need_to_be_rasterized); | 193 const TileVector& tiles_that_need_to_be_rasterized); |
| 188 | 194 |
| 189 void AssignGpuMemoryToTiles(PrioritizedTileSet* tiles, | 195 void AssignGpuMemoryToTiles(PrioritizedTileSet* tiles, |
| 190 TileVector* tiles_that_need_to_be_rasterized); | 196 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_; | 270 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
| 265 | 271 |
| 266 UniqueNotifier ready_to_activate_check_notifier_; | 272 UniqueNotifier ready_to_activate_check_notifier_; |
| 267 | 273 |
| 268 DISALLOW_COPY_AND_ASSIGN(TileManager); | 274 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 269 }; | 275 }; |
| 270 | 276 |
| 271 } // namespace cc | 277 } // namespace cc |
| 272 | 278 |
| 273 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 279 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |