| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/resources/image_raster_worker_pool.h" | 5 #include "cc/resources/image_raster_worker_pool.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/debug/traced_value.h" | 9 #include "cc/debug/traced_value.h" |
| 10 #include "cc/resources/resource.h" | 10 #include "cc/resources/resource.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 if (!buffer_) | 34 if (!buffer_) |
| 35 return; | 35 return; |
| 36 | 36 |
| 37 SkBitmap bitmap; | 37 SkBitmap bitmap; |
| 38 bitmap.setConfig(SkBitmap::kARGB_8888_Config, | 38 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
| 39 task_->resource()->size().width(), | 39 task_->resource()->size().width(), |
| 40 task_->resource()->size().height(), | 40 task_->resource()->size().height(), |
| 41 stride_); | 41 stride_); |
| 42 bitmap.setPixels(buffer_); | 42 bitmap.setPixels(buffer_); |
| 43 SkDevice device(bitmap); | 43 SkDevice device(bitmap); |
| 44 task_->RunOnWorkerThread(&device, thread_index); | 44 task_->RunOnWorkerThread(thread_index, NULL, gfx::Size()); |
| 45 } | 45 } |
| 46 virtual void CompleteOnOriginThread() OVERRIDE { | 46 virtual void CompleteOnOriginThread() OVERRIDE { |
| 47 reply_.Run(!HasFinishedRunning()); | 47 reply_.Run(!HasFinishedRunning()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 virtual ~ImageWorkerPoolTaskImpl() {} | 51 virtual ~ImageWorkerPoolTaskImpl() {} |
| 52 | 52 |
| 53 scoped_refptr<internal::RasterWorkerPoolTask> task_; | 53 scoped_refptr<internal::RasterWorkerPoolTask> task_; |
| 54 uint8_t* buffer_; | 54 uint8_t* buffer_; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 if (is_required_for_activation) { | 217 if (is_required_for_activation) { |
| 218 raster_required_for_activation_finished_node->add_dependency(); | 218 raster_required_for_activation_finished_node->add_dependency(); |
| 219 image_node->add_dependent(raster_required_for_activation_finished_node); | 219 image_node->add_dependent(raster_required_for_activation_finished_node); |
| 220 } | 220 } |
| 221 | 221 |
| 222 raster_finished_node->add_dependency(); | 222 raster_finished_node->add_dependency(); |
| 223 image_node->add_dependent(raster_finished_node); | 223 image_node->add_dependent(raster_finished_node); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace cc | 226 } // namespace cc |
| OLD | NEW |