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

Unified Diff: cc/paint/discardable_image_store.cc

Issue 2857923004: cc: Keep PaintImage in DrawImage. (Closed)
Patch Set: dependent branch 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
« no previous file with comments | « cc/paint/discardable_image_store.h ('k') | cc/paint/draw_image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/discardable_image_store.cc
diff --git a/cc/paint/discardable_image_store.cc b/cc/paint/discardable_image_store.cc
index b89b46f82ec6d8c973403c319a18654d906073ed..06057352901a0abb58e95f598d4cb75048e93039 100644
--- a/cc/paint/discardable_image_store.cc
+++ b/cc/paint/discardable_image_store.cc
@@ -187,19 +187,18 @@ void DiscardableImageStore::AddImageFromFlags(const SkRect& rect,
PaintImage::CompletionState::UNKNOWN);
// TODO(ericrk): Handle cases where we only need a sub-rect from the
// image. crbug.com/671821
- AddImage(paint_image, SkRect::MakeFromIRect(image->bounds()), rect,
- &matrix, flags);
+ AddImage(std::move(paint_image), SkRect::MakeFromIRect(image->bounds()),
+ rect, &matrix, flags);
}
}
}
-void DiscardableImageStore::AddImage(const PaintImage& paint_image,
+void DiscardableImageStore::AddImage(PaintImage paint_image,
const SkRect& src_rect,
const SkRect& rect,
const SkMatrix* local_matrix,
const PaintFlags& flags) {
- sk_sp<const SkImage> sk_image = paint_image.sk_image();
- if (!sk_image->isLazyGenerated())
+ if (!paint_image.sk_image()->isLazyGenerated())
return;
const SkRect& clip_rect = SkRect::Make(canvas_->getDeviceClipBounds());
@@ -243,11 +242,10 @@ void DiscardableImageStore::AddImage(const PaintImage& paint_image,
if (local_matrix)
matrix.postConcat(*local_matrix);
- // TODO(khushalsagar): Keep PaintImage in DrawImage.
- (*image_id_to_rect_)[sk_image->uniqueID()].Union(image_rect);
+ (*image_id_to_rect_)[paint_image.sk_image()->uniqueID()].Union(image_rect);
vmpstr 2017/05/09 22:42:54 can you make a comment here to explain why we use
image_set_->push_back(
- std::make_pair(DrawImage(std::move(sk_image), src_irect, filter_quality,
- matrix, target_color_space),
+ std::make_pair(DrawImage(std::move(paint_image), src_irect,
+ filter_quality, matrix, target_color_space),
image_rect));
}
« no previous file with comments | « cc/paint/discardable_image_store.h ('k') | cc/paint/draw_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698