| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Soft limit is used for resource pool such that | 135 // Soft limit is used for resource pool such that |
| 136 // memory returns to soft limit after going over. | 136 // memory returns to soft limit after going over. |
| 137 if (state != global_state_) { | 137 if (state != global_state_) { |
| 138 global_state_ = state; | 138 global_state_ = state; |
| 139 prioritized_tiles_dirty_ = true; | 139 prioritized_tiles_dirty_ = true; |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 void SetRasterizerForTesting(Rasterizer* rasterizer); | 143 void SetRasterizerForTesting(Rasterizer* rasterizer); |
| 144 | 144 |
| 145 void CleanUpReleasedTilesForTesting() { CleanUpReleasedTiles(); } | 145 void FreeResourcesAndCleanUpReleasedTilesForTesting() { |
| 146 prioritized_tiles_.Clear(); |
| 147 FreeResourcesForReleasedTiles(); |
| 148 CleanUpReleasedTiles(); |
| 149 } |
| 146 | 150 |
| 147 protected: | 151 protected: |
| 148 TileManager(TileManagerClient* client, | 152 TileManager(TileManagerClient* client, |
| 149 base::SequencedTaskRunner* task_runner, | 153 base::SequencedTaskRunner* task_runner, |
| 150 ResourcePool* resource_pool, | 154 ResourcePool* resource_pool, |
| 151 Rasterizer* rasterizer, | 155 Rasterizer* rasterizer, |
| 152 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 156 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 153 | 157 |
| 154 // Methods called by Tile | 158 // Methods called by Tile |
| 155 friend class Tile; | 159 friend class Tile; |
| 156 void DidChangeTilePriority(Tile* tile); | 160 void DidChangeTilePriority(Tile* tile); |
| 157 | 161 |
| 162 void FreeResourcesForReleasedTiles(); |
| 158 void CleanUpReleasedTiles(); | 163 void CleanUpReleasedTiles(); |
| 159 | 164 |
| 160 // Overriden from RefCountedManager<Tile>: | 165 // Overriden from RefCountedManager<Tile>: |
| 161 virtual void Release(Tile* tile) OVERRIDE; | 166 virtual void Release(Tile* tile) OVERRIDE; |
| 162 | 167 |
| 163 // Overriden from RasterizerClient: | 168 // Overriden from RasterizerClient: |
| 164 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; | 169 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; |
| 165 virtual void DidFinishRunningTasks() OVERRIDE; | 170 virtual void DidFinishRunningTasks() OVERRIDE; |
| 166 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; | 171 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; |
| 167 | 172 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; | 254 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; |
| 250 | 255 |
| 251 UniqueNotifier ready_to_activate_check_notifier_; | 256 UniqueNotifier ready_to_activate_check_notifier_; |
| 252 | 257 |
| 253 DISALLOW_COPY_AND_ASSIGN(TileManager); | 258 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 254 }; | 259 }; |
| 255 | 260 |
| 256 } // namespace cc | 261 } // namespace cc |
| 257 | 262 |
| 258 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 263 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |