| 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 "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/resources/raster_worker_pool.h" | 10 #include "cc/resources/raster_worker_pool.h" |
| 11 #include "cc/resources/rasterizer.h" | 11 #include "cc/resources/rasterizer.h" |
| 12 | 12 |
| 13 namespace base { |
| 14 namespace debug { |
| 15 class ConvertableToTraceFormat; |
| 16 } |
| 17 } |
| 18 |
| 13 namespace cc { | 19 namespace cc { |
| 14 class ResourceProvider; | 20 class ResourceProvider; |
| 15 | 21 |
| 16 class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, | 22 class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, |
| 17 public Rasterizer, | 23 public Rasterizer, |
| 18 public RasterizerTaskClient { | 24 public RasterizerTaskClient { |
| 19 public: | 25 public: |
| 20 virtual ~ImageRasterWorkerPool(); | 26 virtual ~ImageRasterWorkerPool(); |
| 21 | 27 |
| 22 static scoped_ptr<RasterWorkerPool> Create( | 28 static scoped_ptr<RasterWorkerPool> Create( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 virtual void ReleaseCanvasForRaster(RasterTask* task) OVERRIDE; | 44 virtual void ReleaseCanvasForRaster(RasterTask* task) OVERRIDE; |
| 39 | 45 |
| 40 protected: | 46 protected: |
| 41 ImageRasterWorkerPool(base::SequencedTaskRunner* task_runner, | 47 ImageRasterWorkerPool(base::SequencedTaskRunner* task_runner, |
| 42 TaskGraphRunner* task_graph_runner, | 48 TaskGraphRunner* task_graph_runner, |
| 43 ResourceProvider* resource_provider); | 49 ResourceProvider* resource_provider); |
| 44 | 50 |
| 45 private: | 51 private: |
| 46 void OnRasterFinished(); | 52 void OnRasterFinished(); |
| 47 void OnRasterRequiredForActivationFinished(); | 53 void OnRasterRequiredForActivationFinished(); |
| 48 scoped_ptr<base::Value> StateAsValue() const; | 54 scoped_refptr<base::debug::ConvertableToTraceFormat> StateAsValue() const; |
| 49 | 55 |
| 50 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 56 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 51 TaskGraphRunner* task_graph_runner_; | 57 TaskGraphRunner* task_graph_runner_; |
| 52 const NamespaceToken namespace_token_; | 58 const NamespaceToken namespace_token_; |
| 53 RasterizerClient* client_; | 59 RasterizerClient* client_; |
| 54 ResourceProvider* resource_provider_; | 60 ResourceProvider* resource_provider_; |
| 55 | 61 |
| 56 bool raster_tasks_pending_; | 62 bool raster_tasks_pending_; |
| 57 bool raster_tasks_required_for_activation_pending_; | 63 bool raster_tasks_required_for_activation_pending_; |
| 58 | 64 |
| 59 base::WeakPtrFactory<ImageRasterWorkerPool> raster_finished_weak_ptr_factory_; | 65 base::WeakPtrFactory<ImageRasterWorkerPool> raster_finished_weak_ptr_factory_; |
| 60 | 66 |
| 61 scoped_refptr<RasterizerTask> raster_finished_task_; | 67 scoped_refptr<RasterizerTask> raster_finished_task_; |
| 62 scoped_refptr<RasterizerTask> raster_required_for_activation_finished_task_; | 68 scoped_refptr<RasterizerTask> raster_required_for_activation_finished_task_; |
| 63 | 69 |
| 64 // Task graph used when scheduling tasks and vector used to gather | 70 // Task graph used when scheduling tasks and vector used to gather |
| 65 // completed tasks. | 71 // completed tasks. |
| 66 TaskGraph graph_; | 72 TaskGraph graph_; |
| 67 Task::Vector completed_tasks_; | 73 Task::Vector completed_tasks_; |
| 68 | 74 |
| 69 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); | 75 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 } // namespace cc | 78 } // namespace cc |
| 73 | 79 |
| 74 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ | 80 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_ |
| OLD | NEW |