Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: cc/resources/image_raster_worker_pool.cc

Issue 22796028: Updating Chromium to Skia SkBaseDevice/SkBitmapDevice split (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODOs Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "third_party/skia/include/core/SkDevice.h" 11 #include "third_party/skia/include/core/SkBitmapDevice.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 namespace { 15 namespace {
16 16
17 class ImageWorkerPoolTaskImpl : public internal::WorkerPoolTask { 17 class ImageWorkerPoolTaskImpl : public internal::WorkerPoolTask {
18 public: 18 public:
19 typedef base::Callback<void(bool was_canceled)> Reply; 19 typedef base::Callback<void(bool was_canceled)> Reply;
20 20
21 ImageWorkerPoolTaskImpl(internal::RasterWorkerPoolTask* task, 21 ImageWorkerPoolTaskImpl(internal::RasterWorkerPoolTask* task,
(...skipping 11 matching lines...) Expand all
33 TRACE_EVENT0("cc", "ImageWorkerPoolTaskImpl::RunOnWorkerThread"); 33 TRACE_EVENT0("cc", "ImageWorkerPoolTaskImpl::RunOnWorkerThread");
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 SkBitmapDevice device(bitmap);
44 task_->RunOnWorkerThread(&device, thread_index); 44 task_->RunOnWorkerThread(&device, thread_index);
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_;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (is_required_for_activation) { 221 if (is_required_for_activation) {
222 raster_required_for_activation_finished_node->add_dependency(); 222 raster_required_for_activation_finished_node->add_dependency();
223 image_node->add_dependent(raster_required_for_activation_finished_node); 223 image_node->add_dependent(raster_required_for_activation_finished_node);
224 } 224 }
225 225
226 raster_finished_node->add_dependency(); 226 raster_finished_node->add_dependency();
227 image_node->add_dependent(raster_finished_node); 227 image_node->add_dependent(raster_finished_node);
228 } 228 }
229 229
230 } // namespace cc 230 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/bitmap_skpicture_content_layer_updater.cc ('k') | cc/resources/pixel_buffer_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698