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, | 17 ResourceProvider* resource_provider, |
| 18 ContextProvider* context_provider, |
18 size_t num_threads, | 19 size_t num_threads, |
19 GLenum texture_target) { | 20 GLenum texture_target) { |
20 return make_scoped_ptr<RasterWorkerPool>( | 21 return make_scoped_ptr<RasterWorkerPool>( |
21 new ImageRasterWorkerPool(resource_provider, | 22 new ImageRasterWorkerPool(resource_provider, |
| 23 context_provider, |
22 num_threads, | 24 num_threads, |
23 texture_target)); | 25 texture_target)); |
24 } | 26 } |
25 | 27 |
26 // Overridden from RasterWorkerPool: | 28 // Overridden from RasterWorkerPool: |
27 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; | 29 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; |
28 virtual GLenum GetResourceTarget() const OVERRIDE; | 30 virtual GLenum GetResourceTarget() const OVERRIDE; |
29 virtual ResourceFormat GetResourceFormat() const OVERRIDE; | 31 virtual ResourceFormat GetResourceFormat() const OVERRIDE; |
30 virtual void OnRasterTasksFinished() OVERRIDE; | 32 virtual void OnRasterTasksFinished() OVERRIDE; |
31 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; | 33 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; |
32 | 34 |
33 private: | 35 private: |
34 ImageRasterWorkerPool(ResourceProvider* resource_provider, | 36 ImageRasterWorkerPool(ResourceProvider* resource_provider, |
| 37 ContextProvider* context_provider, |
35 size_t num_threads, | 38 size_t num_threads, |
36 GLenum texture_target); | 39 GLenum texture_target); |
37 | 40 |
38 void OnRasterTaskCompleted( | 41 void OnRasterTaskCompleted( |
39 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); | 42 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); |
40 | 43 |
41 scoped_ptr<base::Value> StateAsValue() const; | 44 scoped_ptr<base::Value> StateAsValue() const; |
42 | 45 |
43 static void CreateGraphNodeForImageTask( | 46 static void CreateGraphNodeForImageTask( |
44 internal::WorkerPoolTask* image_task, | 47 internal::WorkerPoolTask* image_task, |
(...skipping 10 matching lines...) Expand all Loading... |
55 | 58 |
56 bool raster_tasks_pending_; | 59 bool raster_tasks_pending_; |
57 bool raster_tasks_required_for_activation_pending_; | 60 bool raster_tasks_required_for_activation_pending_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); | 62 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace cc | 65 } // namespace cc |
63 | 66 |
64 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ | 67 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
OLD | NEW |