Pass through the profile info when creating a high-quality scaled offscreen.
authorherb <herb@google.com>
Mon, 18 Apr 2016 21:06:21 +0000 (14:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 18 Apr 2016 21:06:21 +0000 (14:06 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1897043002

Review URL: https://codereview.chromium.org/1897043002

src/core/SkBitmapScaler.cpp

index 398e20c..fb72875 100644 (file)
@@ -250,7 +250,10 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr, const SkPixmap& source, ResizeM
     }
 
     SkBitmap result;
-    result.setInfo(SkImageInfo::MakeN32(destWidth, destHeight, source.alphaType()));
+    // Note: pass along the profile information even thought this is no the right answer because
+    // this could be scaling in sRGB.
+    result.setInfo(SkImageInfo::MakeN32(destWidth, destHeight,
+                                        source.alphaType(), source.info().profileType()));
     result.allocPixels(allocator, nullptr);
 
     SkPixmap resultPM;