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