OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RASTER_WORKER_POOL_H_ | 5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_ |
6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ | 6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 scoped_refptr<internal::RasterWorkerPoolTask> internal_; | 186 scoped_refptr<internal::RasterWorkerPoolTask> internal_; |
187 }; | 187 }; |
188 | 188 |
189 virtual ~RasterWorkerPool(); | 189 virtual ~RasterWorkerPool(); |
190 | 190 |
191 static void SetNumRasterThreads(int num_threads); | 191 static void SetNumRasterThreads(int num_threads); |
192 | 192 |
193 static int GetNumRasterThreads(); | 193 static int GetNumRasterThreads(); |
194 | 194 |
| 195 static internal::TaskGraphRunner* GetTaskGraphRunner(); |
| 196 |
| 197 static unsigned kOnDemandRasterTaskPriority; |
| 198 static unsigned kRasterFinishedTaskPriority; |
| 199 static unsigned kRasterRequiredForActivationFinishedTaskPriority; |
| 200 static unsigned kRasterTaskPriorityBase; |
| 201 |
195 // TODO(vmpstr): Figure out an elegant way to not pass this many parameters. | 202 // TODO(vmpstr): Figure out an elegant way to not pass this many parameters. |
196 static RasterTask CreateRasterTask( | 203 static RasterTask CreateRasterTask( |
197 const Resource* resource, | 204 const Resource* resource, |
198 PicturePileImpl* picture_pile, | 205 PicturePileImpl* picture_pile, |
199 const gfx::Rect& content_rect, | 206 const gfx::Rect& content_rect, |
200 float contents_scale, | 207 float contents_scale, |
201 RasterMode raster_mode, | 208 RasterMode raster_mode, |
202 TileResolution tile_resolution, | 209 TileResolution tile_resolution, |
203 int layer_id, | 210 int layer_id, |
204 const void* tile_id, | 211 const void* tile_id, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 internal::WorkerPoolTask* task, | 321 internal::WorkerPoolTask* task, |
315 unsigned priority, | 322 unsigned priority, |
316 size_t dependencies); | 323 size_t dependencies); |
317 | 324 |
318 static void InsertNodeForRasterTask( | 325 static void InsertNodeForRasterTask( |
319 internal::TaskGraph* graph, | 326 internal::TaskGraph* graph, |
320 internal::WorkerPoolTask* task, | 327 internal::WorkerPoolTask* task, |
321 const internal::Task::Vector& decode_tasks, | 328 const internal::Task::Vector& decode_tasks, |
322 unsigned priority); | 329 unsigned priority); |
323 | 330 |
324 static unsigned kRasterFinishedTaskPriority; | |
325 static unsigned kRasterRequiredForActivationFinishedTaskPriority; | |
326 static unsigned kRasterTaskPriorityBase; | |
327 | |
328 private: | 331 private: |
329 void OnRasterFinished(const internal::WorkerPoolTask* source); | 332 void OnRasterFinished(const internal::WorkerPoolTask* source); |
330 void OnRasterRequiredForActivationFinished( | 333 void OnRasterRequiredForActivationFinished( |
331 const internal::WorkerPoolTask* source); | 334 const internal::WorkerPoolTask* source); |
332 | 335 |
333 internal::TaskGraphRunner* task_graph_runner_; | 336 internal::TaskGraphRunner* task_graph_runner_; |
334 internal::NamespaceToken namespace_token_; | 337 internal::NamespaceToken namespace_token_; |
335 RasterWorkerPoolClient* client_; | 338 RasterWorkerPoolClient* client_; |
336 ResourceProvider* resource_provider_; | 339 ResourceProvider* resource_provider_; |
337 ContextProvider* context_provider_; | 340 ContextProvider* context_provider_; |
338 TaskDeque completed_gpu_raster_tasks_; | 341 TaskDeque completed_gpu_raster_tasks_; |
339 | 342 |
340 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; | 343 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; |
341 scoped_refptr<internal::WorkerPoolTask> | 344 scoped_refptr<internal::WorkerPoolTask> |
342 raster_required_for_activation_finished_task_; | 345 raster_required_for_activation_finished_task_; |
343 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; | 346 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; |
344 }; | 347 }; |
345 | 348 |
346 } // namespace cc | 349 } // namespace cc |
347 | 350 |
348 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 351 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
OLD | NEW |