OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tiles/image_controller.h" | 5 #include "cc/tiles/image_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/task_scheduler/post_task.h" | 8 #include "base/task_scheduler/post_task.h" |
9 #include "base/task_scheduler/task_traits.h" | 9 #include "base/task_scheduler/task_traits.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 // TODO(ccameron): The target color space specified here should match the | 189 // TODO(ccameron): The target color space specified here should match the |
190 // target color space that will be used at rasterization time. Leave this | 190 // target color space that will be used at rasterization time. Leave this |
191 // unspecified now, since that will match the rasterization-time color | 191 // unspecified now, since that will match the rasterization-time color |
192 // space while color correct rendering is disabled. | 192 // space while color correct rendering is disabled. |
193 gfx::ColorSpace target_color_space; | 193 gfx::ColorSpace target_color_space; |
194 | 194 |
195 DCHECK(image); | 195 DCHECK(image); |
196 bool is_image_lazy = image->isLazyGenerated(); | 196 bool is_image_lazy = image->isLazyGenerated(); |
197 auto image_bounds = image->bounds(); | 197 auto image_bounds = image->bounds(); |
198 DrawImage draw_image(std::move(image), image_bounds, kNone_SkFilterQuality, | 198 DrawImage draw_image(PaintImage(std::move(image)), image_bounds, |
199 SkMatrix::I(), target_color_space); | 199 kNone_SkFilterQuality, SkMatrix::I(), |
| 200 target_color_space); |
200 | 201 |
201 // Get the tasks for this decode. | 202 // Get the tasks for this decode. |
202 scoped_refptr<TileTask> task; | 203 scoped_refptr<TileTask> task; |
203 bool need_unref = false; | 204 bool need_unref = false; |
204 if (is_image_lazy) { | 205 if (is_image_lazy) { |
205 need_unref = | 206 need_unref = |
206 cache_->GetOutOfRasterDecodeTaskForImageAndRef(draw_image, &task); | 207 cache_->GetOutOfRasterDecodeTaskForImageAndRef(draw_image, &task); |
207 } | 208 } |
208 // If we don't need to unref this, we don't actually have a task. | 209 // If we don't need to unref this, we don't actually have a task. |
209 DCHECK(need_unref || !task); | 210 DCHECK(need_unref || !task); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 ImageController::ImageDecodeRequest::ImageDecodeRequest( | 375 ImageController::ImageDecodeRequest::ImageDecodeRequest( |
375 const ImageDecodeRequest& other) = default; | 376 const ImageDecodeRequest& other) = default; |
376 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default; | 377 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default; |
377 | 378 |
378 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: | 379 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: |
379 operator=(ImageDecodeRequest&& other) = default; | 380 operator=(ImageDecodeRequest&& other) = default; |
380 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: | 381 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: |
381 operator=(const ImageDecodeRequest& other) = default; | 382 operator=(const ImageDecodeRequest& other) = default; |
382 | 383 |
383 } // namespace cc | 384 } // namespace cc |
OLD | NEW |