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
This commit is contained in:
parent
795423198b
commit
e26a8ad620
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user