#ifndef CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_
#define CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_
#include "cc/resources/raster_worker_pool.h"
#include "base/values.h"
namespace cc {
class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool {
public:
virtual ~ImageRasterWorkerPool();
static scoped_ptr<RasterWorkerPool> Create(
base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
unsigned texture_target);
virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
virtual unsigned GetResourceTarget() const OVERRIDE;
virtual ResourceFormat GetResourceFormat() const OVERRIDE;
virtual void CheckForCompletedTasks() OVERRIDE;
virtual SkCanvas* AcquireCanvasForRaster(internal::WorkerPoolTask* task,
const Resource* resource) OVERRIDE;
virtual void ReleaseCanvasForRaster(internal::WorkerPoolTask* task,
const Resource* resource) OVERRIDE;
protected:
ImageRasterWorkerPool(base::SequencedTaskRunner* task_runner,
internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
unsigned texture_target);
private:
virtual void OnRasterTasksFinished() OVERRIDE;
virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE;
scoped_ptr<base::Value> StateAsValue() const;
const unsigned texture_target_;
bool raster_tasks_pending_;
bool raster_tasks_required_for_activation_pending_;
internal::TaskGraph graph_;
internal::Task::Vector completed_tasks_;
DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool);
};
}
#endif