Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eebb28b authored by Matt Sarett's avatar Matt Sarett
Browse files

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
parent 5548196f
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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