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

Side by Side Diff: cc/tile_manager.h

Issue 12217105: cc: Check for completed raster tasks at interval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: confine polling to inside worker pool 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 <vector> 10 #include <vector>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return; 144 return;
145 client_->ScheduleManageTiles(); 145 client_->ScheduleManageTiles();
146 manage_tiles_pending_ = true; 146 manage_tiles_pending_ = true;
147 } 147 }
148 void DispatchMoreTasks(); 148 void DispatchMoreTasks();
149 void GatherPixelRefsForTile(Tile* tile); 149 void GatherPixelRefsForTile(Tile* tile);
150 void DispatchImageDecodeTasksForTile(Tile* tile); 150 void DispatchImageDecodeTasksForTile(Tile* tile);
151 void DispatchOneImageDecodeTask( 151 void DispatchOneImageDecodeTask(
152 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); 152 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref);
153 void OnImageDecodeTaskCompleted( 153 void OnImageDecodeTaskCompleted(
154 scoped_refptr<Tile> tile, uint32_t pixel_ref_id); 154 scoped_refptr<Tile> tile,
155 uint32_t pixel_ref_id,
156 bool more_tasks_completed);
155 bool CanDispatchRasterTask(Tile* tile); 157 bool CanDispatchRasterTask(Tile* tile);
156 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); 158 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile);
157 void DispatchOneRasterTask(scoped_refptr<Tile> tile); 159 void DispatchOneRasterTask(scoped_refptr<Tile> tile);
158 void PerformOneRaster(Tile* tile); 160 void PerformOneRaster(Tile* tile);
159 void OnRasterCompleted( 161 void OnRasterCompleted(
160 scoped_refptr<Tile> tile, 162 scoped_refptr<Tile> tile,
161 scoped_ptr<ResourcePool::Resource> resource, 163 scoped_ptr<ResourcePool::Resource> resource,
162 int manage_tiles_call_count_when_dispatched); 164 int manage_tiles_call_count_when_dispatched);
163 void OnRasterTaskCompleted( 165 void OnRasterTaskCompleted(
164 scoped_refptr<Tile> tile, 166 scoped_refptr<Tile> tile,
165 scoped_ptr<ResourcePool::Resource> resource, 167 scoped_ptr<ResourcePool::Resource> resource,
166 int manage_tiles_call_count_when_dispatched); 168 int manage_tiles_call_count_when_dispatched,
169 bool more_tasks_completed);
nduca 2013/02/13 08:29:32 might tweak the name, i cant quite tell if this me
reveman 2013/02/13 08:46:38 more_tasks_have_completed?
167 void DidFinishTileInitialization(Tile* tile); 170 void DidFinishTileInitialization(Tile* tile);
168 void DidTileRasterStateChange(Tile* tile, TileRasterState state); 171 void DidTileRasterStateChange(Tile* tile, TileRasterState state);
169 void DidTileBinChange(Tile* tile, 172 void DidTileBinChange(Tile* tile,
170 TileManagerBin bin, 173 TileManagerBin bin,
171 WhichTree tree); 174 WhichTree tree);
172 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; 175 scoped_ptr<Value> GetMemoryRequirementsAsValue() const;
173 176
174 static void PerformRaster(uint8* buffer, 177 static void PerformRaster(uint8* buffer,
175 const gfx::Rect& rect, 178 const gfx::Rect& rect,
176 float contents_scale, 179 float contents_scale,
(...skipping 19 matching lines...) Expand all
196 TileVector tiles_that_need_to_be_rasterized_; 199 TileVector tiles_that_need_to_be_rasterized_;
197 200
198 typedef std::list<Tile*> TileList; 201 typedef std::list<Tile*> TileList;
199 // Tiles with image decoding tasks. These tiles need to be rasterized 202 // Tiles with image decoding tasks. These tiles need to be rasterized
200 // when all the image decoding tasks finish. 203 // when all the image decoding tasks finish.
201 TileList tiles_with_image_decoding_tasks_; 204 TileList tiles_with_image_decoding_tasks_;
202 205
203 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; 206 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap;
204 PixelRefMap pending_decode_tasks_; 207 PixelRefMap pending_decode_tasks_;
205 208
209 size_t bytes_pending_raster_;
210
206 typedef std::queue<scoped_refptr<Tile> > TileQueue; 211 typedef std::queue<scoped_refptr<Tile> > TileQueue;
207 TileQueue tiles_with_pending_set_pixels_; 212 TileQueue tiles_with_pending_set_pixels_;
208 size_t bytes_pending_set_pixels_; 213 size_t bytes_pending_set_pixels_;
214 bool need_shallow_flush_;
209 bool ever_exceeded_memory_budget_; 215 bool ever_exceeded_memory_budget_;
210 MemoryHistory::Entry memory_stats_from_last_assign_; 216 MemoryHistory::Entry memory_stats_from_last_assign_;
211 217
212 bool record_rendering_stats_; 218 bool record_rendering_stats_;
213 RenderingStats rendering_stats_; 219 RenderingStats rendering_stats_;
214 220
215 bool use_cheapness_estimator_; 221 bool use_cheapness_estimator_;
216 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; 222 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS];
217 223
218 DISALLOW_COPY_AND_ASSIGN(TileManager); 224 DISALLOW_COPY_AND_ASSIGN(TileManager);
219 }; 225 };
220 226
221 } // namespace cc 227 } // namespace cc
222 228
223 #endif // CC_TILE_MANAGER_H_ 229 #endif // CC_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/raster_worker_pool.cc ('k') | cc/tile_manager.cc » ('j') | cc/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698