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_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ | 5 #ifndef CC_RESOURCES_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ |
6 #define CC_RESOURCES_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ | 6 #define CC_RESOURCES_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/cancelable_callback.h" |
12 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
13 #include "cc/resources/raster_worker_pool.h" | 14 #include "cc/resources/raster_worker_pool.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 | 17 |
17 class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool { | 18 class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool { |
18 public: | 19 public: |
19 virtual ~PixelBufferRasterWorkerPool(); | 20 virtual ~PixelBufferRasterWorkerPool(); |
20 | 21 |
21 static scoped_ptr<RasterWorkerPool> Create( | 22 static scoped_ptr<RasterWorkerPool> Create( |
22 ResourceProvider* resource_provider, | 23 ResourceProvider* resource_provider, |
23 ContextProvider* context_provider, | 24 ContextProvider* context_provider, |
24 size_t max_transfer_buffer_usage_bytes) { | 25 size_t max_transfer_buffer_usage_bytes) { |
25 return make_scoped_ptr<RasterWorkerPool>( | 26 return make_scoped_ptr<RasterWorkerPool>( |
26 new PixelBufferRasterWorkerPool(resource_provider, | 27 new PixelBufferRasterWorkerPool(resource_provider, |
27 context_provider, | 28 context_provider, |
28 max_transfer_buffer_usage_bytes)); | 29 max_transfer_buffer_usage_bytes)); |
29 } | 30 } |
30 | 31 |
31 // Overridden from WorkerPool: | 32 // Overridden from WorkerPool: |
32 virtual void Shutdown() OVERRIDE; | 33 virtual void Shutdown() OVERRIDE; |
33 | 34 |
34 // Overridden from RasterWorkerPool: | 35 // Overridden from RasterWorkerPool: |
35 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; | 36 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE; |
36 virtual GLenum GetResourceTarget() const OVERRIDE; | 37 virtual unsigned GetResourceTarget() const OVERRIDE; |
37 virtual ResourceFormat GetResourceFormat() const OVERRIDE; | 38 virtual ResourceFormat GetResourceFormat() const OVERRIDE; |
38 virtual void CheckForCompletedTasks() OVERRIDE; | 39 virtual void CheckForCompletedTasks() OVERRIDE; |
39 virtual void OnRasterTasksFinished() OVERRIDE; | 40 virtual void OnRasterTasksFinished() OVERRIDE; |
40 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; | 41 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE; |
41 | 42 |
42 private: | 43 private: |
43 PixelBufferRasterWorkerPool(ResourceProvider* resource_provider, | 44 PixelBufferRasterWorkerPool(ResourceProvider* resource_provider, |
44 ContextProvider* context_provider, | 45 ContextProvider* context_provider, |
45 size_t max_transfer_buffer_usage_bytes); | 46 size_t max_transfer_buffer_usage_bytes); |
46 | 47 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool raster_finished_task_pending_; | 82 bool raster_finished_task_pending_; |
82 bool raster_required_for_activation_finished_task_pending_; | 83 bool raster_required_for_activation_finished_task_pending_; |
83 ResourceFormat format_; | 84 ResourceFormat format_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(PixelBufferRasterWorkerPool); | 86 DISALLOW_COPY_AND_ASSIGN(PixelBufferRasterWorkerPool); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace cc | 89 } // namespace cc |
89 | 90 |
90 #endif // CC_RESOURCES_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ | 91 #endif // CC_RESOURCES_PIXEL_BUFFER_RASTER_WORKER_POOL_H_ |
OLD | NEW |