| 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 11 matching lines...) Expand all Loading... |
| 22 task_(task) { | 22 task_(task) { |
| 23 DCHECK(picture_pile_); | 23 DCHECK(picture_pile_); |
| 24 } | 24 } |
| 25 | 25 |
| 26 virtual bool IsCheap() OVERRIDE { return is_cheap_; } | 26 virtual bool IsCheap() OVERRIDE { return is_cheap_; } |
| 27 | 27 |
| 28 virtual void WillRunOnThread(unsigned thread_index) OVERRIDE { | 28 virtual void WillRunOnThread(unsigned thread_index) OVERRIDE { |
| 29 picture_pile_ = picture_pile_->GetCloneForDrawingOnThread(thread_index); | 29 picture_pile_ = picture_pile_->GetCloneForDrawingOnThread(thread_index); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void Run(RenderingStats* rendering_stats) OVERRIDE { | 32 virtual void Run() OVERRIDE { |
| 33 task_.Run(picture_pile_.get(), rendering_stats); | 33 task_.Run(picture_pile_.get()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 scoped_refptr<PicturePileImpl> picture_pile_; | 37 scoped_refptr<PicturePileImpl> picture_pile_; |
| 38 bool is_cheap_; | 38 bool is_cheap_; |
| 39 RasterWorkerPool::RasterCallback task_; | 39 RasterWorkerPool::RasterCallback task_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 const char* kWorkerThreadNamePrefix = "CompositorRaster"; | 42 const char* kWorkerThreadNamePrefix = "CompositorRaster"; |
| 43 | 43 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 const RasterCallback& task, | 61 const RasterCallback& task, |
| 62 const base::Closure& reply) { | 62 const base::Closure& reply) { |
| 63 PostTask(make_scoped_ptr(new RasterWorkerPoolTaskImpl( | 63 PostTask(make_scoped_ptr(new RasterWorkerPoolTaskImpl( |
| 64 picture_pile, | 64 picture_pile, |
| 65 is_cheap, | 65 is_cheap, |
| 66 task, | 66 task, |
| 67 reply)).PassAs<internal::WorkerPoolTask>()); | 67 reply)).PassAs<internal::WorkerPoolTask>()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace cc | 70 } // namespace cc |
| OLD | NEW |