Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: cc/resources/tile_manager.h

Issue 22900018: cc: Set the mapped memory reclaim limit for the renderer compositor on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
45 // should no longer have any memory assigned to them. Tile objects are "owned" 45 // should no longer have any memory assigned to them. Tile objects are "owned"
46 // by layers; they automatically register with the manager when they are 46 // by layers; they automatically register with the manager when they are
47 // created, and unregister from the manager when they are deleted. 47 // created, and unregister from the manager when they are deleted.
48 class CC_EXPORT TileManager : public RasterWorkerPoolClient { 48 class CC_EXPORT TileManager : public RasterWorkerPoolClient {
49 public: 49 public:
50 static scoped_ptr<TileManager> Create( 50 static scoped_ptr<TileManager> Create(
51 TileManagerClient* client, 51 TileManagerClient* client,
52 ResourceProvider* resource_provider, 52 ResourceProvider* resource_provider,
53 size_t num_raster_threads, 53 size_t num_raster_threads,
54 RenderingStatsInstrumentation* rendering_stats_instrumentation, 54 RenderingStatsInstrumentation* rendering_stats_instrumentation,
55 bool use_map_image); 55 bool use_map_image,
56 ContextProvider* context_provider);
56 virtual ~TileManager(); 57 virtual ~TileManager();
57 58
58 const GlobalStateThatImpactsTilePriority& GlobalState() const { 59 const GlobalStateThatImpactsTilePriority& GlobalState() const {
59 return global_state_; 60 return global_state_;
60 } 61 }
61 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 62 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
62 63
63 void ManageTiles(); 64 void ManageTiles();
64 65
65 // Returns true when visible tiles have been initialized. 66 // Returns true when visible tiles have been initialized.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 RasterMode DetermineRasterMode(const Tile* tile) const; 145 RasterMode DetermineRasterMode(const Tile* tile) const;
145 void CleanUpUnusedImageDecodeTasks(); 146 void CleanUpUnusedImageDecodeTasks();
146 void FreeResourceForTile(Tile* tile, RasterMode mode); 147 void FreeResourceForTile(Tile* tile, RasterMode mode);
147 void FreeResourcesForTile(Tile* tile); 148 void FreeResourcesForTile(Tile* tile);
148 void FreeUnusedResourcesForTile(Tile* tile); 149 void FreeUnusedResourcesForTile(Tile* tile);
149 RasterWorkerPool::Task CreateImageDecodeTask( 150 RasterWorkerPool::Task CreateImageDecodeTask(
150 Tile* tile, skia::LazyPixelRef* pixel_ref); 151 Tile* tile, skia::LazyPixelRef* pixel_ref);
151 RasterWorkerPool::RasterTask CreateRasterTask(Tile* tile); 152 RasterWorkerPool::RasterTask CreateRasterTask(Tile* tile);
152 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; 153 scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const;
153 PrioritizedTileSet* GetPrioritizedTileSet(); 154 PrioritizedTileSet* GetPrioritizedTileSet();
155 static size_t GetMaxBytesPendingUpload(ContextProvider* context_provider);
danakj 2013/09/03 17:18:57 should this have a forward declaration in this fil
kaanb 2013/09/03 20:43:11 Moved to anonymous namespace in LTHI
154 156
155 TileManagerClient* client_; 157 TileManagerClient* client_;
156 scoped_ptr<ResourcePool> resource_pool_; 158 scoped_ptr<ResourcePool> resource_pool_;
157 scoped_ptr<RasterWorkerPool> raster_worker_pool_; 159 scoped_ptr<RasterWorkerPool> raster_worker_pool_;
158 GlobalStateThatImpactsTilePriority global_state_; 160 GlobalStateThatImpactsTilePriority global_state_;
159 161
160 typedef base::hash_map<Tile::Id, Tile*> TileMap; 162 typedef base::hash_map<Tile::Id, Tile*> TileMap;
161 TileMap tiles_; 163 TileMap tiles_;
162 164
163 PrioritizedTileSet prioritized_tiles_; 165 PrioritizedTileSet prioritized_tiles_;
(...skipping 18 matching lines...) Expand all
182 LayerPixelRefTaskMap image_decode_tasks_; 184 LayerPixelRefTaskMap image_decode_tasks_;
183 185
184 RasterTaskCompletionStats update_visible_tiles_stats_; 186 RasterTaskCompletionStats update_visible_tiles_stats_;
185 187
186 DISALLOW_COPY_AND_ASSIGN(TileManager); 188 DISALLOW_COPY_AND_ASSIGN(TileManager);
187 }; 189 };
188 190
189 } // namespace cc 191 } // namespace cc
190 192
191 #endif // CC_RESOURCES_TILE_MANAGER_H_ 193 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698