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

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: Fix clang build Created 7 years, 11 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
« no previous file with comments | « cc/thread_proxy.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
88 void GetMemoryStats(size_t* memoryRequiredBytes,
89 size_t* memoryNiceToHaveBytes,
90 size_t* memoryUsedBytes);
85 91
86 void GetRenderingStats(RenderingStats* stats); 92 void GetRenderingStats(RenderingStats* stats);
87 93
88 int GetTilesInBinCount(TileManagerBin bin, WhichTree tree); 94 int GetTilesInBinCount(TileManagerBin bin, WhichTree tree);
89 int GetDrawableTilesInBinCount(TileManagerBin bin, WhichTree tree); 95 int GetDrawableTilesInBinCount(TileManagerBin bin, WhichTree tree);
90 96
91 protected: 97 protected:
92 // Methods called by Tile 98 // Methods called by Tile
93 friend class Tile; 99 friend class Tile;
94 void RegisterTile(Tile*); 100 void RegisterTile(Tile*);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 RasterThreadVector raster_threads_; 155 RasterThreadVector raster_threads_;
150 156
151 RenderingStats rendering_stats_; 157 RenderingStats rendering_stats_;
152 158
153 DISALLOW_COPY_AND_ASSIGN(TileManager); 159 DISALLOW_COPY_AND_ASSIGN(TileManager);
154 }; 160 };
155 161
156 } // namespace cc 162 } // namespace cc
157 163
158 #endif // CC_TILE_MANAGER_H_ 164 #endif // CC_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/thread_proxy.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698