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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 // - Tile resources freed. | 53 // - Tile resources freed. |
| 54 // - Tile marked for on-demand raster. | 54 // - Tile marked for on-demand raster. |
| 55 virtual void NotifyTileStateChanged(const Tile* tile) = 0; | 55 virtual void NotifyTileStateChanged(const Tile* tile) = 0; |
| 56 | 56 |
| 57 // Given an empty raster tile priority queue, this will build a priority queue | 57 // Given an empty raster tile priority queue, this will build a priority queue |
| 58 // that will return tiles in order in which they should be rasterized. | 58 // that will return tiles in order in which they should be rasterized. |
| 59 // Note if the queue was previous built, Reset must be called on it. | 59 // Note if the queue was previous built, Reset must be called on it. |
| 60 virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, | 60 virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, |
| 61 TreePriority tree_priority) = 0; | 61 TreePriority tree_priority) = 0; |
| 62 | 62 |
| 63 // Called when all tiles from the previous BuildRasterQueue have been | |
|
vmpstr
2014/10/31 15:46:30
drive by nit: This isn't entirely true... It would
danakj
2014/10/31 15:47:30
OK thanks I wasn't really sure what to write here,
| |
| 64 // processed. Each BuildRasterQueue call is followed by either another | |
| 65 // BuildRasterQueue call (when some tiles were processed but not all), or a | |
| 66 // FinishedRasterQueue() call. | |
| 67 virtual void FinishedRasterQueue() = 0; | |
| 68 | |
| 63 // Given an empty eviction tile priority queue, this will build a priority | 69 // Given an empty eviction tile priority queue, this will build a priority |
| 64 // queue that will return tiles in order in which they should be evicted. | 70 // queue that will return tiles in order in which they should be evicted. |
| 65 // Note if the queue was previous built, Reset must be called on it. | 71 // Note if the queue was previous built, Reset must be called on it. |
| 66 virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, | 72 virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, |
| 67 TreePriority tree_priority) = 0; | 73 TreePriority tree_priority) = 0; |
| 68 | 74 |
| 69 protected: | 75 protected: |
| 70 virtual ~TileManagerClient() {} | 76 virtual ~TileManagerClient() {} |
| 71 }; | 77 }; |
| 72 | 78 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 97 TileManagerClient* client, | 103 TileManagerClient* client, |
| 98 base::SequencedTaskRunner* task_runner, | 104 base::SequencedTaskRunner* task_runner, |
| 99 ResourcePool* resource_pool, | 105 ResourcePool* resource_pool, |
| 100 Rasterizer* rasterizer, | 106 Rasterizer* rasterizer, |
| 101 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 107 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 102 size_t scheduled_raster_task_limit); | 108 size_t scheduled_raster_task_limit); |
| 103 ~TileManager() override; | 109 ~TileManager() override; |
| 104 | 110 |
| 105 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); | 111 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); |
| 106 | 112 |
| 107 // Returns true when visible tiles have been initialized. | 113 void UpdateVisibleTiles(); |
| 108 bool UpdateVisibleTiles(); | |
| 109 | 114 |
| 110 scoped_refptr<Tile> CreateTile(RasterSource* raster_source, | 115 scoped_refptr<Tile> CreateTile(RasterSource* raster_source, |
| 111 const gfx::Size& tile_size, | 116 const gfx::Size& tile_size, |
| 112 const gfx::Rect& content_rect, | 117 const gfx::Rect& content_rect, |
| 113 float contents_scale, | 118 float contents_scale, |
| 114 int layer_id, | 119 int layer_id, |
| 115 int source_frame_number, | 120 int source_frame_number, |
| 116 int flags); | 121 int flags); |
| 117 | 122 |
| 118 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue() | 123 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue() |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 const size_t scheduled_raster_task_limit_; | 246 const size_t scheduled_raster_task_limit_; |
| 242 | 247 |
| 243 typedef base::hash_map<Tile::Id, Tile*> TileMap; | 248 typedef base::hash_map<Tile::Id, Tile*> TileMap; |
| 244 TileMap tiles_; | 249 TileMap tiles_; |
| 245 | 250 |
| 246 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; | 251 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; |
| 247 MemoryHistory::Entry memory_stats_from_last_assign_; | 252 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 248 | 253 |
| 249 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 254 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 250 | 255 |
| 251 bool did_initialize_visible_tile_; | |
| 252 bool did_check_for_completed_tasks_since_last_schedule_tasks_; | 256 bool did_check_for_completed_tasks_since_last_schedule_tasks_; |
| 253 bool did_oom_on_last_assign_; | 257 bool did_oom_on_last_assign_; |
| 254 | 258 |
| 255 typedef base::hash_map<uint32_t, scoped_refptr<ImageDecodeTask>> | 259 typedef base::hash_map<uint32_t, scoped_refptr<ImageDecodeTask>> |
| 256 PixelRefTaskMap; | 260 PixelRefTaskMap; |
| 257 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; | 261 typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; |
| 258 LayerPixelRefTaskMap image_decode_tasks_; | 262 LayerPixelRefTaskMap image_decode_tasks_; |
| 259 | 263 |
| 260 typedef base::hash_map<int, int> LayerCountMap; | 264 typedef base::hash_map<int, int> LayerCountMap; |
| 261 LayerCountMap used_layer_counts_; | 265 LayerCountMap used_layer_counts_; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 276 RasterTilePriorityQueue raster_priority_queue_; | 280 RasterTilePriorityQueue raster_priority_queue_; |
| 277 EvictionTilePriorityQueue eviction_priority_queue_; | 281 EvictionTilePriorityQueue eviction_priority_queue_; |
| 278 bool eviction_priority_queue_is_up_to_date_; | 282 bool eviction_priority_queue_is_up_to_date_; |
| 279 | 283 |
| 280 DISALLOW_COPY_AND_ASSIGN(TileManager); | 284 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 281 }; | 285 }; |
| 282 | 286 |
| 283 } // namespace cc | 287 } // namespace cc |
| 284 | 288 |
| 285 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 289 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |