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

Unified Diff: cc/tiles/image_controller.cc

Issue 2857923004: cc: Keep PaintImage in DrawImage. (Closed)
Patch Set: rebased Created 3 years, 7 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
Index: cc/tiles/image_controller.cc
diff --git a/cc/tiles/image_controller.cc b/cc/tiles/image_controller.cc
index 698dc79e2510b8cf78edfc2239cfde3dff78b49c..6a955d954cfd72935aaf4b21cfde554c2523e065 100644
--- a/cc/tiles/image_controller.cc
+++ b/cc/tiles/image_controller.cc
@@ -22,6 +22,7 @@ ImageController::ImageController(
scoped_refptr<base::SequencedTaskRunner> worker_task_runner)
: worker_task_runner_(std::move(worker_task_runner)),
origin_task_runner_(origin_task_runner),
+ paint_image_id_(PaintImage::GetNextId()),
vmpstr 2017/05/12 22:15:42 This is something that we need to talk about I thi
Khushal 2017/05/13 02:45:50 We'll definitely need PaintImage plumbed to cc, in
vmpstr 2017/05/15 15:02:55 My concern is that it doesn't feel that we're clea
Khushal 2017/05/15 21:22:14 ImageHijackCanvas is one use-case. The other one i
weak_ptr_factory_(this) {}
ImageController::~ImageController() {
@@ -195,8 +196,10 @@ ImageController::ImageDecodeRequestId ImageController::QueueImageDecode(
DCHECK(image);
bool is_image_lazy = image->isLazyGenerated();
auto image_bounds = image->bounds();
- DrawImage draw_image(std::move(image), image_bounds, kNone_SkFilterQuality,
- SkMatrix::I(), target_color_space);
+ DrawImage draw_image(
+ PaintImage(paint_image_id_,
+ sk_ref_sp(const_cast<SkImage*>(image.release()))),
+ image_bounds, kNone_SkFilterQuality, SkMatrix::I(), target_color_space);
// Get the tasks for this decode.
scoped_refptr<TileTask> task;

Powered by Google App Engine
This is Rietveld 408576698