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

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

Issue 15855008: cc: Call ManageTiles explicitly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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/layers/picture_layer_impl.cc ('k') | cc/resources/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_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 19 matching lines...) Expand all
30 // quality. 30 // quality.
31 enum TileRasterMode { 31 enum TileRasterMode {
32 HIGH_QUALITY_RASTER_MODE = 0, 32 HIGH_QUALITY_RASTER_MODE = 0,
33 HIGH_QUALITY_NO_LCD_RASTER_MODE = 1, 33 HIGH_QUALITY_NO_LCD_RASTER_MODE = 1,
34 LOW_QUALITY_RASTER_MODE = 2, 34 LOW_QUALITY_RASTER_MODE = 2,
35 NUM_RASTER_MODES = 3 35 NUM_RASTER_MODES = 3
36 }; 36 };
37 37
38 class CC_EXPORT TileManagerClient { 38 class CC_EXPORT TileManagerClient {
39 public: 39 public:
40 virtual void ScheduleManageTiles() = 0;
41 virtual void DidInitializeVisibleTile() = 0; 40 virtual void DidInitializeVisibleTile() = 0;
42 virtual bool 41 virtual bool
43 ShouldForceTileUploadsRequiredForActivationToComplete() const = 0; 42 ShouldForceTileUploadsRequiredForActivationToComplete() const = 0;
44 43
45 protected: 44 protected:
46 virtual ~TileManagerClient() {} 45 virtual ~TileManagerClient() {}
47 }; 46 };
48 47
49 // Tile manager classifying tiles into a few basic 48 // Tile manager classifying tiles into a few basic
50 // bins: 49 // bins:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 scoped_ptr<base::Value> BasicStateAsValue() const; 94 scoped_ptr<base::Value> BasicStateAsValue() const;
96 scoped_ptr<base::Value> AllTilesAsValue() const; 95 scoped_ptr<base::Value> AllTilesAsValue() const;
97 void GetMemoryStats(size_t* memory_required_bytes, 96 void GetMemoryStats(size_t* memory_required_bytes,
98 size_t* memory_nice_to_have_bytes, 97 size_t* memory_nice_to_have_bytes,
99 size_t* memory_used_bytes) const; 98 size_t* memory_used_bytes) const;
100 99
101 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 100 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
102 return memory_stats_from_last_assign_; 101 return memory_stats_from_last_assign_;
103 } 102 }
104 103
105 void WillModifyTilePriorities() {
106 ScheduleManageTiles();
107 }
108
109 bool AreTilesRequiredForActivationReady() const { 104 bool AreTilesRequiredForActivationReady() const {
110 return tiles_that_need_to_be_initialized_for_activation_.empty(); 105 return tiles_that_need_to_be_initialized_for_activation_.empty();
111 } 106 }
112 107
113 protected: 108 protected:
114 TileManager(TileManagerClient* client, 109 TileManager(TileManagerClient* client,
115 ResourceProvider* resource_provider, 110 ResourceProvider* resource_provider,
116 scoped_ptr<RasterWorkerPool> raster_worker_pool, 111 scoped_ptr<RasterWorkerPool> raster_worker_pool,
117 size_t num_raster_threads, 112 size_t num_raster_threads,
118 bool use_color_estimator, 113 bool use_color_estimator,
(...skipping 19 matching lines...) Expand all
138 TileRasterMode raster_mode; 133 TileRasterMode raster_mode;
139 }; 134 };
140 135
141 void AssignBinsToTiles(); 136 void AssignBinsToTiles();
142 void SortTiles(); 137 void SortTiles();
143 TileRasterMode DetermineRasterMode(const Tile* tile) const; 138 TileRasterMode DetermineRasterMode(const Tile* tile) const;
144 void AssignGpuMemoryToTiles(); 139 void AssignGpuMemoryToTiles();
145 void FreeResourceForTile(Tile* tile, TileRasterMode mode); 140 void FreeResourceForTile(Tile* tile, TileRasterMode mode);
146 void FreeResourcesForTile(Tile* tile); 141 void FreeResourcesForTile(Tile* tile);
147 void FreeUnusedResourcesForTile(Tile* tile); 142 void FreeUnusedResourcesForTile(Tile* tile);
148 void ScheduleManageTiles() {
149 if (manage_tiles_pending_)
150 return;
151 client_->ScheduleManageTiles();
152 manage_tiles_pending_ = true;
153 }
154 RasterWorkerPool::Task CreateImageDecodeTask( 143 RasterWorkerPool::Task CreateImageDecodeTask(
155 Tile* tile, skia::LazyPixelRef* pixel_ref); 144 Tile* tile, skia::LazyPixelRef* pixel_ref);
156 void OnImageDecodeTaskCompleted( 145 void OnImageDecodeTaskCompleted(
157 scoped_refptr<Tile> tile, 146 scoped_refptr<Tile> tile,
158 uint32_t pixel_ref_id); 147 uint32_t pixel_ref_id);
159 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const; 148 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
160 RasterWorkerPool::RasterTask CreateRasterTask( 149 RasterWorkerPool::RasterTask CreateRasterTask(
161 Tile* tile, 150 Tile* tile,
162 PixelRefSet* decoded_images); 151 PixelRefSet* decoded_images);
163 void OnRasterTaskCompleted( 152 void OnRasterTaskCompleted(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 gfx::Rect rect, 184 gfx::Rect rect,
196 float contents_scale, 185 float contents_scale,
197 const RasterTaskMetadata& metadata, 186 const RasterTaskMetadata& metadata,
198 RenderingStatsInstrumentation* stats_instrumentation, 187 RenderingStatsInstrumentation* stats_instrumentation,
199 SkDevice* device, 188 SkDevice* device,
200 PicturePileImpl* picture_pile); 189 PicturePileImpl* picture_pile);
201 190
202 TileManagerClient* client_; 191 TileManagerClient* client_;
203 scoped_ptr<ResourcePool> resource_pool_; 192 scoped_ptr<ResourcePool> resource_pool_;
204 scoped_ptr<RasterWorkerPool> raster_worker_pool_; 193 scoped_ptr<RasterWorkerPool> raster_worker_pool_;
205 bool manage_tiles_pending_;
206
207 GlobalStateThatImpactsTilePriority global_state_; 194 GlobalStateThatImpactsTilePriority global_state_;
208 195
209 typedef std::vector<Tile*> TileVector; 196 typedef std::vector<Tile*> TileVector;
210 TileVector tiles_; 197 TileVector tiles_;
211 TileVector tiles_that_need_to_be_rasterized_; 198 TileVector tiles_that_need_to_be_rasterized_;
212 typedef std::set<Tile*> TileSet; 199 typedef std::set<Tile*> TileSet;
213 TileSet tiles_that_need_to_be_initialized_for_activation_; 200 TileSet tiles_that_need_to_be_initialized_for_activation_;
214 201
215 typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefMap; 202 typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefMap;
216 PixelRefMap pending_decode_tasks_; 203 PixelRefMap pending_decode_tasks_;
217 204
218 bool ever_exceeded_memory_budget_; 205 bool ever_exceeded_memory_budget_;
219 MemoryHistory::Entry memory_stats_from_last_assign_; 206 MemoryHistory::Entry memory_stats_from_last_assign_;
220 207
221 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 208 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
222 209
223 bool use_color_estimator_; 210 bool use_color_estimator_;
224 bool did_initialize_visible_tile_; 211 bool did_initialize_visible_tile_;
225 212
226 DISALLOW_COPY_AND_ASSIGN(TileManager); 213 DISALLOW_COPY_AND_ASSIGN(TileManager);
227 }; 214 };
228 215
229 } // namespace cc 216 } // namespace cc
230 217
231 #endif // CC_RESOURCES_TILE_MANAGER_H_ 218 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698