Use a colorspace when decoding to F16

A recent change caused us to always pass a color space
to the decoder.  A revert of that change caused us to
never pass a color space to the decoder.

In order to decode to F16 (and pass CTS tests), we
need to pass a color space on decodes to F16.  This
was the "original" behavior before the bad change
and bad revert.

Test: This will allow us to pass CTS.

BUG:33814604

Change-Id: I4e569213f9d4ff5a452149c4b2ee191bf2fe6b0e
This commit is contained in:
Matt Sarett
2016-12-21 16:10:03 -05:00
parent 5548196fe5
commit 6eebb28b18

View File

@@ -395,12 +395,9 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
SkAlphaType alphaType = codec->computeOutputAlphaType(requireUnpremultiplied);
const SkImageInfo decodeInfo = SkImageInfo::Make(size.width(), size.height(),
decodeColorType, alphaType);
decodeColorType, alphaType, GraphicsJNI::colorSpaceForType(decodeColorType));
// We always decode to sRGB, but only mark the bitmap with a color space if linear
// blending is enabled.
SkImageInfo bitmapInfo = decodeInfo.makeColorSpace(
GraphicsJNI::colorSpaceForType(decodeColorType));
SkImageInfo bitmapInfo = decodeInfo;
if (decodeColorType == kGray_8_SkColorType) {
// The legacy implementation of BitmapFactory used kAlpha8 for
// grayscale images (before kGray8 existed). While the codec