From 7a9900d6d34e437bb24beb5524a1f6488ae138c9 Mon Sep 17 00:00:00 2001 From: msarett Date: Thu, 8 Sep 2016 10:14:04 -0700 Subject: Checking for valid colorType, alphaType, colorSpace in SkCodec * Refactor to share code between SkPngCodec and SkWebpCodec * Didn't end up sharing with SkJpegCodec but did refactor that code a bit * Disallow conversions to F16 with non-linear color spaces * Fail to decode if we fail to create a SkColorSpaceXform (should be an assert soon). We used to fallback on a legacy decode if we failed to create the transform. * A bunch of name changes BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2319293003 Review-Url: https://codereview.chromium.org/2319293003 --- dm/DMSrcSink.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dm/DMSrcSink.cpp') diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index caf6f52fe2..fcc4a33a1a 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -896,6 +896,9 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); } + if (kRGBA_F16_SkColorType == fColorType) { + decodeInfo = decodeInfo.makeColorSpace(decodeInfo.colorSpace()->makeLinearGamma()); + } SkImageInfo bitmapInfo = decodeInfo; if (kRGBA_8888_SkColorType == decodeInfo.colorType() || -- cgit v1.2.3