| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/raster_worker_pool.h" | 5 #include "cc/raster_worker_pool.h" |
| 6 | 6 |
| 7 #include "cc/picture_pile_impl.h" | 7 #include "cc/picture_pile_impl.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 task_.Run(picture_pile_.get(), rendering_stats); | 25 task_.Run(picture_pile_.get(), rendering_stats); |
| 26 } | 26 } |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 scoped_refptr<PicturePileImpl> picture_pile_; | 29 scoped_refptr<PicturePileImpl> picture_pile_; |
| 30 RasterWorkerPool::RasterCallback task_; | 30 RasterWorkerPool::RasterCallback task_; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 RasterWorkerPool::RasterWorkerPool( | 35 RasterWorkerPool::RasterWorkerPool(size_t num_threads) |
| 36 size_t num_threads, bool record_rendering_stats) | 36 : WorkerPool(num_threads) { |
| 37 : WorkerPool(num_threads, record_rendering_stats) { | |
| 38 } | 37 } |
| 39 | 38 |
| 40 RasterWorkerPool::~RasterWorkerPool() { | 39 RasterWorkerPool::~RasterWorkerPool() { |
| 41 } | 40 } |
| 42 | 41 |
| 43 void RasterWorkerPool::PostRasterTaskAndReply(PicturePileImpl* picture_pile, | 42 void RasterWorkerPool::PostRasterTaskAndReply(PicturePileImpl* picture_pile, |
| 44 const RasterCallback& task, | 43 const RasterCallback& task, |
| 45 const base::Closure& reply) { | 44 const base::Closure& reply) { |
| 46 Worker* worker = GetWorkerForNextTask(); | 45 Worker* worker = GetWorkerForNextTask(); |
| 47 | 46 |
| 48 scoped_refptr<PicturePileImpl> picture_pile_clone = | 47 scoped_refptr<PicturePileImpl> picture_pile_clone = |
| 49 picture_pile->GetCloneForDrawingOnThread(worker); | 48 picture_pile->GetCloneForDrawingOnThread(worker); |
| 50 | 49 |
| 51 worker->PostTask( | 50 worker->PostTask( |
| 52 make_scoped_ptr(new RasterWorkerPoolTaskImpl( | 51 make_scoped_ptr(new RasterWorkerPoolTaskImpl( |
| 53 picture_pile_clone.get(), | 52 picture_pile_clone.get(), |
| 54 task, | 53 task, |
| 55 reply)).PassAs<internal::WorkerPoolTask>()); | 54 reply)).PassAs<internal::WorkerPoolTask>()); |
| 56 } | 55 } |
| 57 | 56 |
| 58 } // namespace cc | 57 } // namespace cc |
| OLD | NEW |