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

Side by Side Diff: cc/tile_manager.h

Issue 12194015: cc: Rasterize cheap tiles immediately (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix picture pile reference management. Post a task for running cheap tasks. Created 7 years, 10 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 <set> 10 #include <set>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual ~TileManager(); 113 virtual ~TileManager();
114 114
115 const GlobalStateThatImpactsTilePriority& GlobalState() const { 115 const GlobalStateThatImpactsTilePriority& GlobalState() const {
116 return global_state_; 116 return global_state_;
117 } 117 }
118 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 118 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
119 119
120 void ManageTiles(); 120 void ManageTiles();
121 void CheckForCompletedTileUploads(); 121 void CheckForCompletedTileUploads();
122 void AbortPendingTileUploads(); 122 void AbortPendingTileUploads();
123 void DidCompleteFrame();
123 124
124 scoped_ptr<base::Value> BasicStateAsValue() const; 125 scoped_ptr<base::Value> BasicStateAsValue() const;
125 scoped_ptr<base::Value> AllTilesAsValue() const; 126 scoped_ptr<base::Value> AllTilesAsValue() const;
126 void GetMemoryStats(size_t* memoryRequiredBytes, 127 void GetMemoryStats(size_t* memoryRequiredBytes,
127 size_t* memoryNiceToHaveBytes, 128 size_t* memoryNiceToHaveBytes,
128 size_t* memoryUsedBytes) const; 129 size_t* memoryUsedBytes) const;
129 void SetRecordRenderingStats(bool record_rendering_stats); 130 void SetRecordRenderingStats(bool record_rendering_stats);
130 void GetRenderingStats(RenderingStats* stats); 131 void GetRenderingStats(RenderingStats* stats);
131 bool HasPendingWorkScheduled(WhichTree tree) const; 132 bool HasPendingWorkScheduled(WhichTree tree) const;
132 133
(...skipping 27 matching lines...) Expand all
160 manage_tiles_pending_ = true; 161 manage_tiles_pending_ = true;
161 } 162 }
162 void DispatchMoreTasks(); 163 void DispatchMoreTasks();
163 void GatherPixelRefsForTile(Tile* tile); 164 void GatherPixelRefsForTile(Tile* tile);
164 void DispatchImageDecodeTasksForTile(Tile* tile); 165 void DispatchImageDecodeTasksForTile(Tile* tile);
165 void DispatchOneImageDecodeTask( 166 void DispatchOneImageDecodeTask(
166 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); 167 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref);
167 void OnImageDecodeTaskCompleted( 168 void OnImageDecodeTaskCompleted(
168 scoped_refptr<Tile> tile, 169 scoped_refptr<Tile> tile,
169 uint32_t pixel_ref_id); 170 uint32_t pixel_ref_id);
170 bool CanDispatchRasterTask(Tile* tile); 171 bool CanDispatchRasterTask(Tile* tile) const;
171 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); 172 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile);
172 void DispatchOneRasterTask(scoped_refptr<Tile> tile); 173 void DispatchOneRasterTask(scoped_refptr<Tile> tile);
173 void PerformOneRaster(Tile* tile);
174 void OnRasterCompleted( 174 void OnRasterCompleted(
reveman 2013/02/19 18:05:23 we don't need OnRasterCompleted anymore, right? pl
Sami 2013/02/19 22:24:38 Done.
175 scoped_refptr<Tile> tile, 175 scoped_refptr<Tile> tile,
176 scoped_ptr<ResourcePool::Resource> resource, 176 scoped_ptr<ResourcePool::Resource> resource,
177 int manage_tiles_call_count_when_dispatched); 177 int manage_tiles_call_count_when_dispatched);
178 void OnRasterTaskCompleted( 178 void OnRasterTaskCompleted(
179 scoped_refptr<Tile> tile, 179 scoped_refptr<Tile> tile,
180 scoped_ptr<ResourcePool::Resource> resource, 180 scoped_ptr<ResourcePool::Resource> resource,
181 int manage_tiles_call_count_when_dispatched); 181 int manage_tiles_call_count_when_dispatched);
182 void DidFinishTileInitialization(Tile* tile); 182 void DidFinishTileInitialization(Tile* tile);
183 void DidTileRasterStateChange(Tile* tile, TileRasterState state); 183 void DidTileRasterStateChange(Tile* tile, TileRasterState state);
184 void DidTileTreeBinChange(Tile* tile, 184 void DidTileTreeBinChange(Tile* tile,
185 TileManagerBin new_tree_bin, 185 TileManagerBin new_tree_bin,
186 WhichTree tree); 186 WhichTree tree);
187 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; 187 scoped_ptr<Value> GetMemoryRequirementsAsValue() const;
188 188
189 static void PerformRaster(uint8* buffer, 189 static void PerformRaster(uint8* buffer,
190 const gfx::Rect& rect, 190 const gfx::Rect& rect,
191 float contents_scale, 191 float contents_scale,
192 bool use_cheapness_estimator, 192 bool use_cheapness_estimator,
193 const RasterTaskMetadata& raster_task_metadata, 193 const RasterTaskMetadata& raster_task_metadata,
194 PicturePileImpl* picture_pile, 194 PicturePileImpl* picture_pile,
195 RenderingStats* stats); 195 RenderingStats* stats);
196 static void RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, 196 static void PerformImageDecode(skia::LazyPixelRef* pixel_ref,
reveman 2013/02/19 18:05:23 Lets change PerformRaster back to RunRasterTask in
Sami 2013/02/19 22:24:38 Done.
197 RenderingStats* stats); 197 RenderingStats* stats);
198 198
199 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, 199 static void RecordCheapnessPredictorResults(bool is_predicted_cheap,
200 bool is_actually_cheap); 200 bool is_actually_cheap);
201 201
202 TileManagerClient* client_; 202 TileManagerClient* client_;
203 scoped_ptr<ResourcePool> resource_pool_; 203 scoped_ptr<ResourcePool> resource_pool_;
204 scoped_ptr<RasterWorkerPool> raster_worker_pool_; 204 scoped_ptr<RasterWorkerPool> raster_worker_pool_;
205 bool manage_tiles_pending_; 205 bool manage_tiles_pending_;
206 int manage_tiles_call_count_; 206 int manage_tiles_call_count_;
(...skipping 18 matching lines...) Expand all
225 TileQueue tiles_with_pending_set_pixels_; 225 TileQueue tiles_with_pending_set_pixels_;
226 size_t bytes_pending_set_pixels_; 226 size_t bytes_pending_set_pixels_;
227 bool has_performed_uploads_since_last_flush_; 227 bool has_performed_uploads_since_last_flush_;
228 bool ever_exceeded_memory_budget_; 228 bool ever_exceeded_memory_budget_;
229 MemoryHistory::Entry memory_stats_from_last_assign_; 229 MemoryHistory::Entry memory_stats_from_last_assign_;
230 230
231 bool record_rendering_stats_; 231 bool record_rendering_stats_;
232 RenderingStats rendering_stats_; 232 RenderingStats rendering_stats_;
233 233
234 bool use_cheapness_estimator_; 234 bool use_cheapness_estimator_;
235 bool did_schedule_cheap_tasks_;
236 bool allow_cheap_tasks_;
235 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; 237 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS];
236 238
237 DISALLOW_COPY_AND_ASSIGN(TileManager); 239 DISALLOW_COPY_AND_ASSIGN(TileManager);
238 }; 240 };
239 241
240 } // namespace cc 242 } // namespace cc
241 243
242 #endif // CC_TILE_MANAGER_H_ 244 #endif // CC_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698