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

Unified Diff: cc/tiles/image_controller.cc

Issue 2926513003: Use PaintImage in cc QueueImageDecode
Patch Set: rebase Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tiles/image_controller.h ('k') | cc/tiles/image_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/image_controller.cc
diff --git a/cc/tiles/image_controller.cc b/cc/tiles/image_controller.cc
index e8021e4264e0f41845b646f9fa974b3c3c4910d2..70210514f5702e5df2b3070f9539c164d5bce93b 100644
--- a/cc/tiles/image_controller.cc
+++ b/cc/tiles/image_controller.cc
@@ -178,7 +178,7 @@ std::vector<scoped_refptr<TileTask>> ImageController::SetPredecodeImages(
}
ImageController::ImageDecodeRequestId ImageController::QueueImageDecode(
- sk_sp<const SkImage> image,
+ const PaintImage& image,
const ImageDecodedCallback& callback) {
// We must not receive any image requests if we have no worker.
CHECK(worker_task_runner_);
@@ -193,14 +193,10 @@ ImageController::ImageDecodeRequestId ImageController::QueueImageDecode(
gfx::ColorSpace target_color_space;
DCHECK(image);
- bool is_image_lazy = image->isLazyGenerated();
- auto image_bounds = image->bounds();
- // TODO(khushalsagar): Eliminate the use of an incorrect id here and have all
- // call-sites provide PaintImage to the ImageController.
- DrawImage draw_image(
- PaintImage(PaintImage::kUnknownStableId,
- sk_sp<SkImage>(const_cast<SkImage*>(image.release()))),
- image_bounds, kNone_SkFilterQuality, SkMatrix::I(), target_color_space);
+ bool is_image_lazy = image.sk_image()->isLazyGenerated();
+ auto image_bounds = image.sk_image()->bounds();
+ DrawImage draw_image(PaintImage(image), image_bounds, kNone_SkFilterQuality,
+ SkMatrix::I(), target_color_space);
// Get the tasks for this decode.
scoped_refptr<TileTask> task;
« no previous file with comments | « cc/tiles/image_controller.h ('k') | cc/tiles/image_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698