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

Unified Diff: cc/tiles/software_image_decode_cache.cc

Issue 2857923004: cc: Keep PaintImage in DrawImage. (Closed)
Patch Set: addressed comments. 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/software_image_decode_cache.cc
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc
index ccc7f2a87e9aa1c255924d2fc187fb86462a4fa6..76e92a8972b6e9613677f257bfaeb1f406ec1264 100644
--- a/cc/tiles/software_image_decode_cache.cc
+++ b/cc/tiles/software_image_decode_cache.cc
@@ -445,11 +445,11 @@ SoftwareImageDecodeCache::DecodeImageInternal(const ImageKey& key,
case kNone_SkFilterQuality:
case kLow_SkFilterQuality:
if (key.should_use_subrect())
- return GetSubrectImageDecode(key, std::move(image));
+ return GetSubrectImageDecode(key, draw_image.paint_image());
return GetOriginalSizeImageDecode(key, std::move(image));
case kMedium_SkFilterQuality:
case kHigh_SkFilterQuality:
- return GetScaledImageDecode(key, std::move(image));
+ return GetScaledImageDecode(key, draw_image.paint_image());
default:
NOTREACHED();
return nullptr;
@@ -611,10 +611,11 @@ SoftwareImageDecodeCache::GetOriginalSizeImageDecode(
std::unique_ptr<SoftwareImageDecodeCache::DecodedImage>
SoftwareImageDecodeCache::GetSubrectImageDecode(const ImageKey& key,
- sk_sp<const SkImage> image) {
+ PaintImage image) {
// Construct a key to use in GetDecodedImageForDrawInternal().
// This allows us to reuse an image in any cache if available.
- gfx::Rect full_image_rect(image->width(), image->height());
+ gfx::Rect full_image_rect(image.sk_image()->width(),
+ image.sk_image()->height());
DrawImage original_size_draw_image(
std::move(image), gfx::RectToSkIRect(full_image_rect),
kNone_SkFilterQuality, SkMatrix::I(), key.target_color_space());
@@ -674,10 +675,11 @@ SoftwareImageDecodeCache::GetSubrectImageDecode(const ImageKey& key,
std::unique_ptr<SoftwareImageDecodeCache::DecodedImage>
SoftwareImageDecodeCache::GetScaledImageDecode(const ImageKey& key,
- sk_sp<const SkImage> image) {
+ PaintImage image) {
// Construct a key to use in GetDecodedImageForDrawInternal().
// This allows us to reuse an image in any cache if available.
- gfx::Rect full_image_rect(image->width(), image->height());
+ gfx::Rect full_image_rect(image.sk_image()->width(),
+ image.sk_image()->height());
DrawImage original_size_draw_image(
std::move(image), gfx::RectToSkIRect(full_image_rect),
kNone_SkFilterQuality, SkMatrix::I(), key.target_color_space());

Powered by Google App Engine
This is Rietveld 408576698