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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // This class manages tiles, deciding which should get rasterized and which | 45 // This class manages tiles, deciding which should get rasterized and which |
46 // should no longer have any memory assigned to them. Tile objects are "owned" | 46 // should no longer have any memory assigned to them. Tile objects are "owned" |
47 // by layers; they automatically register with the manager when they are | 47 // by layers; they automatically register with the manager when they are |
48 // created, and unregister from the manager when they are deleted. | 48 // created, and unregister from the manager when they are deleted. |
49 class CC_EXPORT TileManager : public RasterWorkerPoolClient, | 49 class CC_EXPORT TileManager : public RasterWorkerPoolClient, |
50 public RefCountedManager<Tile> { | 50 public RefCountedManager<Tile> { |
51 public: | 51 public: |
52 static scoped_ptr<TileManager> Create( | 52 static scoped_ptr<TileManager> Create( |
53 TileManagerClient* client, | 53 TileManagerClient* client, |
54 ResourceProvider* resource_provider, | 54 ResourceProvider* resource_provider, |
55 size_t num_raster_threads, | |
56 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 55 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
57 bool use_map_image, | 56 bool use_map_image, |
58 size_t max_transfer_buffer_usage_bytes, | 57 size_t max_transfer_buffer_usage_bytes, |
59 size_t max_raster_usage_bytes, | 58 size_t max_raster_usage_bytes, |
60 GLenum map_image_texture_target); | 59 GLenum map_image_texture_target); |
61 virtual ~TileManager(); | 60 virtual ~TileManager(); |
62 | 61 |
63 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); | 62 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); |
64 | 63 |
65 // Returns true when visible tiles have been initialized. | 64 // Returns true when visible tiles have been initialized. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 global_state_.memory_limit_in_bytes, | 112 global_state_.memory_limit_in_bytes, |
114 global_state_.unused_memory_limit_in_bytes, | 113 global_state_.unused_memory_limit_in_bytes, |
115 global_state_.num_resources_limit); | 114 global_state_.num_resources_limit); |
116 } | 115 } |
117 } | 116 } |
118 | 117 |
119 protected: | 118 protected: |
120 TileManager(TileManagerClient* client, | 119 TileManager(TileManagerClient* client, |
121 ResourceProvider* resource_provider, | 120 ResourceProvider* resource_provider, |
122 scoped_ptr<RasterWorkerPool> raster_worker_pool, | 121 scoped_ptr<RasterWorkerPool> raster_worker_pool, |
123 size_t num_raster_threads, | |
124 size_t max_raster_usage_bytes, | 122 size_t max_raster_usage_bytes, |
125 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 123 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
126 | 124 |
127 // Methods called by Tile | 125 // Methods called by Tile |
128 friend class Tile; | 126 friend class Tile; |
129 void DidChangeTilePriority(Tile* tile); | 127 void DidChangeTilePriority(Tile* tile); |
130 | 128 |
131 void CleanUpReleasedTiles(); | 129 void CleanUpReleasedTiles(); |
132 | 130 |
133 // Overriden from RefCountedManager<Tile>: | 131 // Overriden from RefCountedManager<Tile>: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 RasterTaskCompletionStats update_visible_tiles_stats_; | 214 RasterTaskCompletionStats update_visible_tiles_stats_; |
217 | 215 |
218 std::vector<Tile*> released_tiles_; | 216 std::vector<Tile*> released_tiles_; |
219 | 217 |
220 DISALLOW_COPY_AND_ASSIGN(TileManager); | 218 DISALLOW_COPY_AND_ASSIGN(TileManager); |
221 }; | 219 }; |
222 | 220 |
223 } // namespace cc | 221 } // namespace cc |
224 | 222 |
225 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 223 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |