summaryrefslogtreecommitdiffstats
path: root/cc/resources/raster_worker_pool.h
blob: 055794626269af0469ad307db549db2f9746e35a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_
#define CC_RESOURCES_RASTER_WORKER_POOL_H_

#include <string>

#include "cc/base/worker_pool.h"

namespace cc {
class PicturePileImpl;

// A worker thread pool that runs raster tasks.
class RasterWorkerPool : public WorkerPool {
 public:
  typedef base::Callback<void(PicturePileImpl*)>
      RasterCallback;

  virtual ~RasterWorkerPool();

  static scoped_ptr<RasterWorkerPool> Create(
      WorkerPoolClient* client, size_t num_threads) {
    return make_scoped_ptr(new RasterWorkerPool(client, num_threads));
  }

  void PostRasterTaskAndReply(PicturePileImpl* picture_pile,
                              bool is_cheap,
                              const RasterCallback& task,
                              const base::Closure& reply);

 private:
  RasterWorkerPool(WorkerPoolClient* client, size_t num_threads);

  DISALLOW_COPY_AND_ASSIGN(RasterWorkerPool);
};

}  // namespace cc

#endif  // CC_RESOURCES_RASTER_WORKER_POOL_H_