1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_
6 #define CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_
10 #include "cc/resources/raster_worker_pool.h"
14 class RasterWorkerPoolDelegate : public RasterWorkerPoolClient {
16 virtual ~RasterWorkerPoolDelegate();
18 static scoped_ptr<RasterWorkerPoolDelegate> Create(
19 RasterWorkerPoolClient* client,
20 RasterWorkerPool** raster_worker_pools,
21 size_t num_raster_worker_pools);
23 void SetClient(RasterWorkerPoolClient* client);
25 void ScheduleTasks(RasterWorkerPool::RasterTask::Queue* raster_queue);
26 void CheckForCompletedTasks();
28 // Overriden from RasterWorkerPoolClient:
29 virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE;
30 virtual void DidFinishRunningTasks() OVERRIDE;
31 virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE;
34 RasterWorkerPoolDelegate(RasterWorkerPoolClient* client,
35 RasterWorkerPool** raster_worker_pools,
36 size_t num_raster_worker_pools);
38 RasterWorkerPoolClient* client_;
39 typedef std::vector<RasterWorkerPool*> RasterWorkerPoolVector;
40 RasterWorkerPoolVector raster_worker_pools_;
41 size_t did_finish_running_tasks_pending_count_;
42 size_t did_finish_running_tasks_required_for_activation_pending_count_;
47 #endif // CC_RESOURCES_RASTER_WORKER_POOL_DELEGATE_H_