raster_worker_pool.h revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
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. 4 5#ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_ 6#define CC_RESOURCES_RASTER_WORKER_POOL_H_ 7 8#include <string> 9 10#include "cc/base/worker_pool.h" 11 12namespace cc { 13class PicturePileImpl; 14 15// A worker thread pool that runs raster tasks. 16class CC_EXPORT RasterWorkerPool : public WorkerPool { 17 public: 18 typedef base::Callback<void(PicturePileImpl* picture_pile)> RasterCallback; 19 20 virtual ~RasterWorkerPool(); 21 22 static scoped_ptr<RasterWorkerPool> Create(size_t num_threads) { 23 return make_scoped_ptr(new RasterWorkerPool(num_threads)); 24 } 25 26 void PostRasterTaskAndReply(PicturePileImpl* picture_pile, 27 const RasterCallback& task, 28 const base::Closure& reply); 29 30 private: 31 explicit RasterWorkerPool(size_t num_threads); 32 33 DISALLOW_COPY_AND_ASSIGN(RasterWorkerPool); 34}; 35 36} // namespace cc 37 38#endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ 39