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

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: Schedule cheap tasks in 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 virtual ~TileManager(); 104 virtual ~TileManager();
105 105
106 const GlobalStateThatImpactsTilePriority& GlobalState() const { 106 const GlobalStateThatImpactsTilePriority& GlobalState() const {
107 return global_state_; 107 return global_state_;
108 } 108 }
109 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 109 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
110 110
111 void ManageTiles(); 111 void ManageTiles();
112 void CheckForCompletedTileUploads(); 112 void CheckForCompletedTileUploads();
113 void AbortPendingTileUploads(); 113 void AbortPendingTileUploads();
114 void DidCompleteFrame();
114 115
115 scoped_ptr<base::Value> BasicStateAsValue() const; 116 scoped_ptr<base::Value> BasicStateAsValue() const;
116 scoped_ptr<base::Value> AllTilesAsValue() const; 117 scoped_ptr<base::Value> AllTilesAsValue() const;
117 void GetMemoryStats(size_t* memoryRequiredBytes, 118 void GetMemoryStats(size_t* memoryRequiredBytes,
118 size_t* memoryNiceToHaveBytes, 119 size_t* memoryNiceToHaveBytes,
119 size_t* memoryUsedBytes) const; 120 size_t* memoryUsedBytes) const;
120 void SetRecordRenderingStats(bool record_rendering_stats); 121 void SetRecordRenderingStats(bool record_rendering_stats);
121 void GetRenderingStats(RenderingStats* stats); 122 void GetRenderingStats(RenderingStats* stats);
122 bool HasPendingWorkScheduled(WhichTree tree) const; 123 bool HasPendingWorkScheduled(WhichTree tree) const;
123 124
(...skipping 21 matching lines...) Expand all
145 client_->ScheduleManageTiles(); 146 client_->ScheduleManageTiles();
146 manage_tiles_pending_ = true; 147 manage_tiles_pending_ = true;
147 } 148 }
148 void DispatchMoreTasks(); 149 void DispatchMoreTasks();
149 void GatherPixelRefsForTile(Tile* tile); 150 void GatherPixelRefsForTile(Tile* tile);
150 void DispatchImageDecodeTasksForTile(Tile* tile); 151 void DispatchImageDecodeTasksForTile(Tile* tile);
151 void DispatchOneImageDecodeTask( 152 void DispatchOneImageDecodeTask(
152 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); 153 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref);
153 void OnImageDecodeTaskCompleted( 154 void OnImageDecodeTaskCompleted(
154 scoped_refptr<Tile> tile, uint32_t pixel_ref_id); 155 scoped_refptr<Tile> tile, uint32_t pixel_ref_id);
155 bool CanDispatchRasterTask(Tile* tile); 156 bool CanDispatchRasterTask(Tile* tile) const;
156 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile); 157 scoped_ptr<ResourcePool::Resource> PrepareTileForRaster(Tile* tile);
157 void DispatchOneRasterTask(scoped_refptr<Tile> tile); 158 void DispatchOneRasterTask(scoped_refptr<Tile> tile);
158 void PerformOneRaster(Tile* tile);
159 void OnRasterCompleted( 159 void OnRasterCompleted(
160 scoped_refptr<Tile> tile, 160 scoped_refptr<Tile> tile,
161 scoped_ptr<ResourcePool::Resource> resource, 161 scoped_ptr<ResourcePool::Resource> resource,
162 int manage_tiles_call_count_when_dispatched); 162 int manage_tiles_call_count_when_dispatched);
163 void OnRasterTaskCompleted( 163 void OnRasterTaskCompleted(
164 scoped_refptr<Tile> tile, 164 scoped_refptr<Tile> tile,
165 scoped_ptr<ResourcePool::Resource> resource, 165 scoped_ptr<ResourcePool::Resource> resource,
166 int manage_tiles_call_count_when_dispatched); 166 int manage_tiles_call_count_when_dispatched);
167 void DidFinishTileInitialization(Tile* tile); 167 void DidFinishTileInitialization(Tile* tile);
168 void DidTileRasterStateChange(Tile* tile, TileRasterState state); 168 void DidTileRasterStateChange(Tile* tile, TileRasterState state);
169 void DidTileTreeBinChange(Tile* tile, 169 void DidTileTreeBinChange(Tile* tile,
170 TileManagerBin new_tree_bin, 170 TileManagerBin new_tree_bin,
171 WhichTree tree); 171 WhichTree tree);
172 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; 172 scoped_ptr<Value> GetMemoryRequirementsAsValue() const;
173 173
174 static void PerformRaster(uint8* buffer, 174 static void PerformRaster(uint8* buffer,
175 const gfx::Rect& rect, 175 const gfx::Rect& rect,
176 float contents_scale, 176 float contents_scale,
177 bool use_cheapness_estimator, 177 bool use_cheapness_estimator,
178 PicturePileImpl* picture_pile, 178 PicturePileImpl* picture_pile,
179 RenderingStats* stats); 179 RenderingStats* stats);
180 static void RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, 180 static void PerformImageDecode(skia::LazyPixelRef* pixel_ref,
181 RenderingStats* stats); 181 RenderingStats* stats);
182 182
183 static void RecordCheapnessPredictorResults(bool is_predicted_cheap, 183 static void RecordCheapnessPredictorResults(bool is_predicted_cheap,
184 bool is_actually_cheap); 184 bool is_actually_cheap);
185 185
186 TileManagerClient* client_; 186 TileManagerClient* client_;
187 scoped_ptr<ResourcePool> resource_pool_; 187 scoped_ptr<ResourcePool> resource_pool_;
188 scoped_ptr<RasterWorkerPool> raster_worker_pool_; 188 scoped_ptr<RasterWorkerPool> raster_worker_pool_;
189 bool manage_tiles_pending_; 189 bool manage_tiles_pending_;
190 int manage_tiles_call_count_; 190 int manage_tiles_call_count_;
(...skipping 24 matching lines...) Expand all
215 215
216 bool use_cheapness_estimator_; 216 bool use_cheapness_estimator_;
217 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; 217 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS];
218 218
219 DISALLOW_COPY_AND_ASSIGN(TileManager); 219 DISALLOW_COPY_AND_ASSIGN(TileManager);
220 }; 220 };
221 221
222 } // namespace cc 222 } // namespace cc
223 223
224 #endif // CC_TILE_MANAGER_H_ 224 #endif // CC_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698