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 ContextProvider* context_provider, |
19 GLenum texture_target) { | 19 unsigned texture_target) { |
20 return make_scoped_ptr<RasterWorkerPool>( | 20 return make_scoped_ptr<RasterWorkerPool>( |
21 new ImageRasterWorkerPool(resource_provider, | 21 new ImageRasterWorkerPool(resource_provider, |
22 context_provider, | 22 context_provider, |
23 texture_target)); | 23 texture_target)); |
24 } | 24 } |
25 | 25 |
26 // Overridden from RasterWorkerPool: | 26 // Overridden from RasterWorkerPool: |
27 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; | 27 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; |
28 virtual GLenum GetResourceTarget() const OVERRIDE; | 28 virtual unsigned GetResourceTarget() const OVERRIDE; |
29 virtual ResourceFormat GetResourceFormat() const OVERRIDE; | 29 virtual ResourceFormat GetResourceFormat() const OVERRIDE; |
30 virtual void OnRasterTasksFinished() OVERRIDE; | 30 virtual void OnRasterTasksFinished() OVERRIDE; |
31 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; | 31 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 ImageRasterWorkerPool(ResourceProvider* resource_provider, | 34 ImageRasterWorkerPool(ResourceProvider* resource_provider, |
35 ContextProvider* context_provider, | 35 ContextProvider* context_provider, |
36 GLenum texture_target); | 36 unsigned texture_target); |
37 | 37 |
38 void OnRasterTaskCompleted( | 38 void OnRasterTaskCompleted( |
39 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); | 39 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled); |
40 | 40 |
41 scoped_ptr<base::Value> StateAsValue() const; | 41 scoped_ptr<base::Value> StateAsValue() const; |
42 | 42 |
43 static void CreateGraphNodeForImageTask( | 43 static void CreateGraphNodeForImageTask( |
44 internal::WorkerPoolTask* image_task, | 44 internal::WorkerPoolTask* image_task, |
45 const TaskVector& decode_tasks, | 45 const internal::Task::Vector& decode_tasks, |
46 unsigned priority, | 46 unsigned priority, |
47 bool is_required_for_activation, | 47 bool is_required_for_activation, |
48 internal::GraphNode* raster_required_for_activation_finished_node, | 48 internal::GraphNode* raster_required_for_activation_finished_node, |
49 internal::GraphNode* raster_finished_node, | 49 internal::GraphNode* raster_finished_node, |
50 TaskGraph* graph); | 50 TaskGraph* graph); |
51 | 51 |
52 const GLenum texture_target_; | 52 const unsigned texture_target_; |
53 | 53 |
54 TaskMap image_tasks_; | 54 TaskMap image_tasks_; |
55 | 55 |
56 bool raster_tasks_pending_; | 56 bool raster_tasks_pending_; |
57 bool raster_tasks_required_for_activation_pending_; | 57 bool raster_tasks_required_for_activation_pending_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); | 59 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace cc | 62 } // namespace cc |
63 | 63 |
64 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ | 64 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
OLD | NEW |