aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/android
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-09-01 17:47:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-01 17:47:46 -0700
commite26a8ad620945623bb418247073e578d14b62f87 (patch)
tree9beed0d32f87a7a0d18ed95901840095ac91ef37 /src/android
parent795423198ba883393a56196c6ea4481efabba311 (diff)
Request legacy mode behavior from SkCodec in BitmapRegionDecoder
Png assets look funny when we perform a correct, linear premultiply. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302953002 Review-Url: https://codereview.chromium.org/2302953002
Diffstat (limited to 'src/android')
-rw-r--r--src/android/SkBitmapRegionCodec.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp
index a335432b31..9c21484ec5 100644
--- a/src/android/SkBitmapRegionCodec.cpp
+++ b/src/android/SkBitmapRegionCodec.cpp
@@ -52,9 +52,12 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat
// Create the image info for the decode
SkColorType dstColorType = fCodec->computeOutputColorType(prefColorType);
SkAlphaType dstAlphaType = fCodec->computeOutputAlphaType(requireUnpremul);
- SkImageInfo decodeInfo = fCodec->getInfo().makeWH(scaledSize.width(), scaledSize.height())
- .makeColorType(dstColorType)
- .makeAlphaType(dstAlphaType);
+
+ // Enable legacy behavior to avoid any gamma correction. Android's assets are
+ // adjusted to expect a non-gamma correct premultiply.
+ sk_sp<SkColorSpace> colorSpace = nullptr;
+ SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(),
+ dstColorType, dstAlphaType, colorSpace);
// Construct a color table for the decode if necessary
SkAutoTUnref<SkColorTable> colorTable(nullptr);