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_IMAGE_RASTER_WORKER_POOL_H_ | 5 #ifndef CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
6 #define CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ | 6 #define CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include "cc/resources/raster_worker_pool.h" | 8 #include "cc/resources/raster_worker_pool.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool { | 12 class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool { |
13 public: | 13 public: |
14 virtual ~ImageRasterWorkerPool(); | 14 virtual ~ImageRasterWorkerPool(); |
15 | 15 |
16 static scoped_ptr<RasterWorkerPool> Create( | 16 static scoped_ptr<RasterWorkerPool> Create( |
17 ResourceProvider* resource_provider, size_t num_threads) { | 17 ResourceProvider* resource_provider, size_t num_threads) { |
18 return make_scoped_ptr<RasterWorkerPool>( | 18 return make_scoped_ptr<RasterWorkerPool>( |
19 new ImageRasterWorkerPool(resource_provider, num_threads)); | 19 new ImageRasterWorkerPool(resource_provider, num_threads)); |
20 } | 20 } |
21 | 21 |
| 22 // Overridden from WorkerPool: |
| 23 virtual void Shutdown() OVERRIDE; |
| 24 |
22 // Overridden from RasterWorkerPool: | 25 // Overridden from RasterWorkerPool: |
23 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; | 26 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; |
24 | 27 |
25 private: | 28 private: |
26 ImageRasterWorkerPool(ResourceProvider* resource_provider, | 29 ImageRasterWorkerPool(ResourceProvider* resource_provider, |
27 size_t num_threads); | 30 size_t num_threads); |
28 | 31 |
| 32 void OnRasterFinished(int64 schedule_raster_tasks_count); |
| 33 void OnRasterRequiredForActivationFinished( |
| 34 int64 schedule_raster_tasks_count); |
| 35 |
29 void OnRasterTaskCompleted( | 36 void OnRasterTaskCompleted( |
30 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); | 37 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); |
31 | 38 |
32 TaskMap image_tasks_; | 39 TaskMap image_tasks_; |
33 | 40 |
| 41 base::WeakPtrFactory<ImageRasterWorkerPool> weak_ptr_factory_; |
| 42 int64 schedule_raster_tasks_count_; |
| 43 |
| 44 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; |
| 45 scoped_refptr<internal::WorkerPoolTask> |
| 46 raster_required_for_activation_finished_task_; |
| 47 |
34 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); | 48 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); |
35 }; | 49 }; |
36 | 50 |
37 } // namespace cc | 51 } // namespace cc |
38 | 52 |
39 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ | 53 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
OLD | NEW |