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

Side by Side Diff: cc/tile_manager.h

Issue 11637022: Send memory management policies to the tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate discussions Created 7 years, 12 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 | Annotate | Revision Log
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_TILE_MANAGER_H_ 5 #ifndef CC_TILE_MANAGER_H_
6 #define CC_TILE_MANAGER_H_ 6 #define CC_TILE_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <queue> 9 #include <queue>
10 #include <vector> 10 #include <vector>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 scoped_ptr<ResourcePool::Resource> resource; 55 scoped_ptr<ResourcePool::Resource> resource;
56 bool resource_is_being_initialized; 56 bool resource_is_being_initialized;
57 bool contents_swizzled; 57 bool contents_swizzled;
58 bool need_to_gather_pixel_refs; 58 bool need_to_gather_pixel_refs;
59 std::list<skia::LazyPixelRef*> pending_pixel_refs; 59 std::list<skia::LazyPixelRef*> pending_pixel_refs;
60 60
61 // Ephemeral state, valid only during Manage. 61 // Ephemeral state, valid only during Manage.
62 TileManagerBin bin[NUM_TREES]; 62 TileManagerBin bin[NUM_TREES];
63 // Bin used to determine raster priority. 63 // Bin used to determine raster priority.
64 TileManagerBin raster_bin; 64 TileManagerBin raster_bin;
65 // The bin that the tile would have if the GPU memory manager had a maximally permissive policy,
66 // send to the GPU memory manager to determine policy.
67 TileManagerBin gpu_memmgr_stats_bin;
65 TileResolution resolution; 68 TileResolution resolution;
66 float time_to_needed_in_seconds; 69 float time_to_needed_in_seconds;
67 }; 70 };
68 71
69 // This class manages tiles, deciding which should get rasterized and which 72 // This class manages tiles, deciding which should get rasterized and which
70 // should no longer have any memory assigned to them. Tile objects are "owned" 73 // should no longer have any memory assigned to them. Tile objects are "owned"
71 // by layers; they automatically register with the manager when they are 74 // by layers; they automatically register with the manager when they are
72 // created, and unregister from the manager when they are deleted. 75 // created, and unregister from the manager when they are deleted.
73 class CC_EXPORT TileManager { 76 class CC_EXPORT TileManager {
74 public: 77 public:
75 TileManager(TileManagerClient* client, 78 TileManager(TileManagerClient* client,
76 ResourceProvider *resource_provider, 79 ResourceProvider *resource_provider,
77 size_t num_raster_threads); 80 size_t num_raster_threads);
78 virtual ~TileManager(); 81 virtual ~TileManager();
79 82
80 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_ state_; } 83 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_ state_; }
81 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 84 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
82 85
83 void ManageTiles(); 86 void ManageTiles();
84 void CheckForCompletedSetPixels(); 87 void CheckForCompletedSetPixels();
85 88
86 void GetRenderingStats(RenderingStats* stats); 89 void GetRenderingStats(RenderingStats* stats);
87 90
88 int GetTilesInBinCount(TileManagerBin bin, WhichTree tree); 91 int GetTilesInBinCount(TileManagerBin bin, WhichTree tree);
89 int GetDrawableTilesInBinCount(TileManagerBin bin, WhichTree tree); 92 int GetDrawableTilesInBinCount(TileManagerBin bin, WhichTree tree);
90 93
94 void GetManagedMemoryStats(
95 size_t* memoryVisibleBytes,
96 size_t* memoryVisibleAndNearbyBytes,
97 size_t* memoryUseBytes);
98
91 protected: 99 protected:
92 // Methods called by Tile 100 // Methods called by Tile
93 friend class Tile; 101 friend class Tile;
94 void RegisterTile(Tile*); 102 void RegisterTile(Tile*);
95 void UnregisterTile(Tile*); 103 void UnregisterTile(Tile*);
96 void WillModifyTilePriority(Tile*, WhichTree, const TilePriority& new_priority ); 104 void WillModifyTilePriority(Tile*, WhichTree, const TilePriority& new_priority );
97 105
98 private: 106 private:
99 void ResetBinCounts(); 107 void ResetBinCounts();
100 void AssignGpuMemoryToTiles(); 108 void AssignGpuMemoryToTiles();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 RasterThreadVector raster_threads_; 157 RasterThreadVector raster_threads_;
150 158
151 RenderingStats rendering_stats_; 159 RenderingStats rendering_stats_;
152 160
153 DISALLOW_COPY_AND_ASSIGN(TileManager); 161 DISALLOW_COPY_AND_ASSIGN(TileManager);
154 }; 162 };
155 163
156 } // namespace cc 164 } // namespace cc
157 165
158 #endif // CC_TILE_MANAGER_H_ 166 #endif // CC_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698