Track webapp meta tag adoption
[chromium-blink-merge.git] / cc / resources / image_raster_worker_pool.h
blob6352649335069ed3288888d3dad36f59d9d6f82f
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
3 // found in the LICENSE file.
5 #ifndef CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_
6 #define CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_
8 #include "cc/resources/raster_worker_pool.h"
10 namespace cc {
12 class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool {
13 public:
14 virtual ~ImageRasterWorkerPool();
16 static scoped_ptr<RasterWorkerPool> Create(
17 ResourceProvider* resource_provider, size_t num_threads) {
18 return make_scoped_ptr<RasterWorkerPool>(
19 new ImageRasterWorkerPool(resource_provider, num_threads));
22 // Overridden from RasterWorkerPool:
23 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE;
24 virtual ResourceFormat GetResourceFormat() const OVERRIDE;
25 virtual void OnRasterTasksFinished() OVERRIDE;
26 virtual void OnRasterTasksRequiredForActivationFinished() OVERRIDE;
28 private:
29 ImageRasterWorkerPool(ResourceProvider* resource_provider,
30 size_t num_threads);
32 void OnRasterTaskCompleted(
33 scoped_refptr<internal::RasterWorkerPoolTask> task, bool was_canceled);
35 scoped_ptr<base::Value> StateAsValue() const;
37 static void CreateGraphNodeForImageTask(
38 internal::WorkerPoolTask* image_task,
39 const TaskVector& decode_tasks,
40 unsigned priority,
41 bool is_required_for_activation,
42 internal::GraphNode* raster_required_for_activation_finished_node,
43 internal::GraphNode* raster_finished_node,
44 TaskGraph* graph);
46 TaskMap image_tasks_;
48 bool raster_tasks_pending_;
49 bool raster_tasks_required_for_activation_pending_;
51 DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool);
54 } // namespace cc
56 #endif // CC_RESOURCES_IMAGE_RASTER_WORKER_POOL_H_