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

Commit 9cf894cd authored by Matt Sarett's avatar Matt Sarett Committed by Android (Google) Code Review
Browse files

Merge "Decode to sRGB in BitmapFactory"

parents 87a66afe 2312cdca
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -395,9 +395,11 @@ 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, GraphicsJNI::defaultColorSpace());
            decodeColorType, alphaType, codec->computeOutputColorSpace(decodeColorType));

    SkImageInfo bitmapInfo = decodeInfo;
    // We always decode to sRGB, but only mark the bitmap with a color space if linear
    // blending is enabled.
    SkImageInfo bitmapInfo = decodeInfo.makeColorSpace(GraphicsJNI::defaultColorSpace());
    if (decodeColorType == kGray_8_SkColorType) {
        // The legacy implementation of BitmapFactory used kAlpha8 for
        // grayscale images (before kGray8 existed).  While the codec