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 <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 void UnregisterTile(Tile* tile); | 104 void UnregisterTile(Tile* tile); |
| 105 | 105 |
| 106 // Overriden from RasterWorkerPoolClient: | 106 // Overriden from RasterWorkerPoolClient: |
| 107 virtual bool ShouldForceTasksRequiredForActivationToComplete() const | 107 virtual bool ShouldForceTasksRequiredForActivationToComplete() const |
| 108 OVERRIDE; | 108 OVERRIDE; |
| 109 | 109 |
| 110 // Virtual for test | 110 // Virtual for test |
| 111 virtual void ScheduleTasks(); | 111 virtual void ScheduleTasks(); |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 typedef uint64 ManagedTileId; | |
|
reveman
2013/07/03 00:32:47
can you move this to the Tile class instead? Tile:
vmpstr
2013/07/03 19:08:04
I added a todo here. Right now doing this would ca
reveman
2013/07/03 20:20:06
Ah, lets just make sure this is fixed before landi
vmpstr
2013/07/03 23:47:51
Agreed.
| |
| 114 void OnImageDecodeTaskCompleted( | 115 void OnImageDecodeTaskCompleted( |
| 115 int layer_id, | 116 int layer_id, |
| 116 skia::LazyPixelRef* pixel_ref, | 117 skia::LazyPixelRef* pixel_ref, |
| 117 bool was_canceled); | 118 bool was_canceled); |
| 118 void OnRasterTaskCompleted( | 119 void OnRasterTaskCompleted( |
| 119 scoped_refptr<Tile> tile, | 120 ManagedTileId tile, |
| 120 scoped_ptr<ResourcePool::Resource> resource, | 121 scoped_ptr<ResourcePool::Resource> resource, |
| 121 RasterMode raster_mode, | 122 RasterMode raster_mode, |
| 122 const PicturePileImpl::Analysis& analysis, | 123 const PicturePileImpl::Analysis& analysis, |
| 123 bool was_canceled); | 124 bool was_canceled); |
| 124 | 125 |
| 125 void AssignBinsToTiles(); | 126 void AssignBinsToTiles(); |
| 126 void SortTiles(); | 127 void SortTiles(); |
| 127 RasterMode DetermineRasterMode(const Tile* tile) const; | 128 RasterMode DetermineRasterMode(const Tile* tile) const; |
| 128 void CleanUpUnusedImageDecodeTasks(); | 129 void CleanUpUnusedImageDecodeTasks(); |
| 129 void AssignGpuMemoryToTiles(); | 130 void AssignGpuMemoryToTiles(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 140 WhichTree tree); | 141 WhichTree tree); |
| 141 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; | 142 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; |
| 142 void AddRequiredTileForActivation(Tile* tile); | 143 void AddRequiredTileForActivation(Tile* tile); |
| 143 | 144 |
| 144 TileManagerClient* client_; | 145 TileManagerClient* client_; |
| 145 scoped_ptr<ResourcePool> resource_pool_; | 146 scoped_ptr<ResourcePool> resource_pool_; |
| 146 scoped_ptr<RasterWorkerPool> raster_worker_pool_; | 147 scoped_ptr<RasterWorkerPool> raster_worker_pool_; |
| 147 GlobalStateThatImpactsTilePriority global_state_; | 148 GlobalStateThatImpactsTilePriority global_state_; |
| 148 | 149 |
| 149 typedef std::vector<Tile*> TileVector; | 150 typedef std::vector<Tile*> TileVector; |
| 150 TileVector tiles_; | 151 TileVector tiles_; |
|
reveman
2013/07/03 00:32:47
I think we can remove |tiles_|. It's just local to
vmpstr
2013/07/03 19:08:04
It's also used in DispatchMoreTasks (this avoids a
reveman
2013/07/03 20:20:06
I think we need include some of it in this patch.
vmpstr
2013/07/03 23:47:51
Done.
| |
| 151 TileVector tiles_that_need_to_be_rasterized_; | 152 TileVector tiles_that_need_to_be_rasterized_; |
|
reveman
2013/07/03 00:32:47
|tiles_that_need_to_be_rasterized_| definitely doe
vmpstr
2013/07/03 19:08:04
Done.
| |
| 152 typedef std::set<Tile*> TileSet; | 153 typedef std::set<Tile*> TileSet; |
| 153 TileSet tiles_that_need_to_be_initialized_for_activation_; | 154 TileSet tiles_that_need_to_be_initialized_for_activation_; |
|
reveman
2013/07/03 00:32:47
fyi, I think we can remove this once my "ready to
vmpstr
2013/07/03 19:08:04
Sounds good. I think we would have to rethink the
reveman
2013/07/03 20:20:06
I think it's trivial to replace |tiles_that_need_t
vmpstr
2013/07/03 23:47:51
I'd rather do this separately. Do you mind putting
| |
| 154 | 155 |
| 155 bool ever_exceeded_memory_budget_; | 156 bool ever_exceeded_memory_budget_; |
| 156 MemoryHistory::Entry memory_stats_from_last_assign_; | 157 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 157 | 158 |
| 158 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 159 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 159 | 160 |
| 160 bool did_initialize_visible_tile_; | 161 bool did_initialize_visible_tile_; |
| 161 | 162 |
| 162 GLenum texture_format_; | 163 GLenum texture_format_; |
| 163 | 164 |
| 164 typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefTaskMap; | 165 typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefTaskMap; |
| 165 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; | 166 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; |
| 166 LayerPixelRefTaskMap image_decode_tasks_; | 167 LayerPixelRefTaskMap image_decode_tasks_; |
| 167 | 168 |
| 169 typedef base::hash_map<ManagedTileId, Tile*> ManagedTileMap; | |
|
reveman
2013/07/03 00:32:47
I like naming these based on the value type. How a
vmpstr
2013/07/03 19:08:04
Done.
| |
| 170 ManagedTileMap managed_tile_map_; | |
|
reveman
2013/07/03 00:32:47
we usually don't use the type in the name for thes
vmpstr
2013/07/03 19:08:04
Named it managed_tiles_ for now.
| |
| 171 | |
| 168 DISALLOW_COPY_AND_ASSIGN(TileManager); | 172 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 169 }; | 173 }; |
| 170 | 174 |
| 171 } // namespace cc | 175 } // namespace cc |
| 172 | 176 |
| 173 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 177 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |