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

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

Issue 13859012: cc: Remove cheapness estimator usage from tile manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: still need static_cast to print size_t Created 7 years, 8 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/resources/raster_worker_pool.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 <list> 8 #include <list>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // This class manages tiles, deciding which should get rasterized and which 59 // This class manages tiles, deciding which should get rasterized and which
60 // should no longer have any memory assigned to them. Tile objects are "owned" 60 // should no longer have any memory assigned to them. Tile objects are "owned"
61 // by layers; they automatically register with the manager when they are 61 // by layers; they automatically register with the manager when they are
62 // created, and unregister from the manager when they are deleted. 62 // created, and unregister from the manager when they are deleted.
63 class CC_EXPORT TileManager : public WorkerPoolClient { 63 class CC_EXPORT TileManager : public WorkerPoolClient {
64 public: 64 public:
65 TileManager(TileManagerClient* client, 65 TileManager(TileManagerClient* client,
66 ResourceProvider *resource_provider, 66 ResourceProvider *resource_provider,
67 size_t num_raster_threads, 67 size_t num_raster_threads,
68 bool use_cheapess_estimator,
69 bool use_color_estimator, 68 bool use_color_estimator,
70 bool prediction_benchmarking, 69 bool prediction_benchmarking,
71 RenderingStatsInstrumentation* rendering_stats_instrumentation); 70 RenderingStatsInstrumentation* rendering_stats_instrumentation);
72 virtual ~TileManager(); 71 virtual ~TileManager();
73 72
74 const GlobalStateThatImpactsTilePriority& GlobalState() const { 73 const GlobalStateThatImpactsTilePriority& GlobalState() const {
75 return global_state_; 74 return global_state_;
76 } 75 }
77 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 76 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
78 77
79 void ManageTiles(); 78 void ManageTiles();
80 void CheckForCompletedTileUploads(); 79 void CheckForCompletedTileUploads();
81 void AbortPendingTileUploads(); 80 void AbortPendingTileUploads();
82 void ForceTileUploadToComplete(Tile* tile); 81 void ForceTileUploadToComplete(Tile* tile);
83 void SetAnticipatedDrawTime(base::TimeTicks time);
84 82
85 scoped_ptr<base::Value> BasicStateAsValue() const; 83 scoped_ptr<base::Value> BasicStateAsValue() const;
86 scoped_ptr<base::Value> AllTilesAsValue() const; 84 scoped_ptr<base::Value> AllTilesAsValue() const;
87 void GetMemoryStats(size_t* memory_required_bytes, 85 void GetMemoryStats(size_t* memory_required_bytes,
88 size_t* memory_nice_to_have_bytes, 86 size_t* memory_nice_to_have_bytes,
89 size_t* memory_used_bytes) const; 87 size_t* memory_used_bytes) const;
90 88
91 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 89 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
92 return memory_stats_from_last_assign_; 90 return memory_stats_from_last_assign_;
93 } 91 }
(...skipping 30 matching lines...) Expand all
124 void AssignBinsToTiles(); 122 void AssignBinsToTiles();
125 void SortTiles(); 123 void SortTiles();
126 void AssignGpuMemoryToTiles(); 124 void AssignGpuMemoryToTiles();
127 void FreeResourcesForTile(Tile* tile); 125 void FreeResourcesForTile(Tile* tile);
128 void ScheduleManageTiles() { 126 void ScheduleManageTiles() {
129 if (manage_tiles_pending_) 127 if (manage_tiles_pending_)
130 return; 128 return;
131 client_->ScheduleManageTiles(); 129 client_->ScheduleManageTiles();
132 manage_tiles_pending_ = true; 130 manage_tiles_pending_ = true;
133 } 131 }
134 void UpdateCheapTasksTimeLimit();
135 void AnalyzeTile(Tile* tile); 132 void AnalyzeTile(Tile* tile);
136 void GatherPixelRefsForTile(Tile* tile); 133 void GatherPixelRefsForTile(Tile* tile);
137 void DispatchImageDecodeTasksForTile(Tile* tile); 134 void DispatchImageDecodeTasksForTile(Tile* tile);
138 void DispatchOneImageDecodeTask( 135 void DispatchOneImageDecodeTask(
139 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); 136 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref);
140 void OnImageDecodeTaskCompleted( 137 void OnImageDecodeTaskCompleted(
141 scoped_refptr<Tile> tile, 138 scoped_refptr<Tile> tile,
142 uint32_t pixel_ref_id); 139 uint32_t pixel_ref_id);
143 bool CanDispatchRasterTask(Tile* tile) const; 140 bool CanDispatchRasterTask(Tile* tile) const;
144 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); 141 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile);
(...skipping 12 matching lines...) Expand all
157 uint8* buffer, 154 uint8* buffer,
158 gfx::Rect rect, 155 gfx::Rect rect,
159 float contents_scale, 156 float contents_scale,
160 const RasterTaskMetadata& metadata, 157 const RasterTaskMetadata& metadata,
161 RenderingStatsInstrumentation* stats_instrumentation, 158 RenderingStatsInstrumentation* stats_instrumentation,
162 PicturePileImpl* picture_pile); 159 PicturePileImpl* picture_pile);
163 static void RunImageDecodeTask( 160 static void RunImageDecodeTask(
164 skia::LazyPixelRef* pixel_ref, 161 skia::LazyPixelRef* pixel_ref,
165 RenderingStatsInstrumentation* stats_instrumentation); 162 RenderingStatsInstrumentation* stats_instrumentation);
166 163
167 static void RecordCheapnessPredictorResults(bool is_predicted_cheap,
168 bool is_actually_cheap);
169 static void RecordSolidColorPredictorResults(const SkColor* actual_colors, 164 static void RecordSolidColorPredictorResults(const SkColor* actual_colors,
170 size_t color_count, 165 size_t color_count,
171 bool is_predicted_solid, 166 bool is_predicted_solid,
172 SkColor predicted_color, 167 SkColor predicted_color,
173 bool is_predicted_transparent); 168 bool is_predicted_transparent);
174 169
175 TileManagerClient* client_; 170 TileManagerClient* client_;
176 scoped_ptr<ResourcePool> resource_pool_; 171 scoped_ptr<ResourcePool> resource_pool_;
177 scoped_ptr<RasterWorkerPool> raster_worker_pool_; 172 scoped_ptr<RasterWorkerPool> raster_worker_pool_;
178 bool manage_tiles_pending_; 173 bool manage_tiles_pending_;
(...skipping 12 matching lines...) Expand all
191 186
192 typedef std::queue<scoped_refptr<Tile> > TileQueue; 187 typedef std::queue<scoped_refptr<Tile> > TileQueue;
193 TileQueue tiles_with_pending_upload_; 188 TileQueue tiles_with_pending_upload_;
194 size_t bytes_pending_upload_; 189 size_t bytes_pending_upload_;
195 bool has_performed_uploads_since_last_flush_; 190 bool has_performed_uploads_since_last_flush_;
196 bool ever_exceeded_memory_budget_; 191 bool ever_exceeded_memory_budget_;
197 MemoryHistory::Entry memory_stats_from_last_assign_; 192 MemoryHistory::Entry memory_stats_from_last_assign_;
198 193
199 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 194 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
200 195
201 bool use_cheapness_estimator_;
202 bool use_color_estimator_; 196 bool use_color_estimator_;
203 bool prediction_benchmarking_; 197 bool prediction_benchmarking_;
204 bool did_initialize_visible_tile_; 198 bool did_initialize_visible_tile_;
205 199
206 size_t pending_tasks_; 200 size_t pending_tasks_;
207 size_t max_pending_tasks_; 201 size_t max_pending_tasks_;
208 202
209 base::TimeTicks anticipated_draw_time_;
210
211 DISALLOW_COPY_AND_ASSIGN(TileManager); 203 DISALLOW_COPY_AND_ASSIGN(TileManager);
212 }; 204 };
213 205
214 } // namespace cc 206 } // namespace cc
215 207
216 #endif // CC_RESOURCES_TILE_MANAGER_H_ 208 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698