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

Commit 3b2288dd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "AImageDecoder: Suppress log messages" into rvc-dev am: 0a5b5456

Change-Id: Iff0114dcd3099b729cce77d7735341263d08c118
parents 28c80d87 0a5b5456
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -50,10 +50,8 @@ ImageDecoder::ImageDecoder(std::unique_ptr<SkAndroidCodec> codec, sk_sp<SkPngChu
}

SkAlphaType ImageDecoder::getOutAlphaType() const {
    // While an SkBitmap may want to use kOpaque_SkAlphaType for a performance
    // optimization, this class just outputs raw pixels. Using either
    // premultiplication choice has no effect on decoding an opaque encoded image.
    return mUnpremultipliedRequired ? kUnpremul_SkAlphaType : kPremul_SkAlphaType;
    return opaque() ? kOpaque_SkAlphaType
                    : mUnpremultipliedRequired ? kUnpremul_SkAlphaType : kPremul_SkAlphaType;
}

bool ImageDecoder::setTargetSize(int width, int height) {
@@ -82,8 +80,7 @@ bool ImageDecoder::setTargetSize(int width, int height) {
    SkISize targetSize = { width, height }, decodeSize = targetSize;
    int sampleSize = mCodec->computeSampleSize(&decodeSize);

    if (decodeSize != targetSize && mUnpremultipliedRequired
            && !mCodec->getInfo().isOpaque()) {
    if (decodeSize != targetSize && mUnpremultipliedRequired && !opaque()) {
        return false;
    }

+0 −3
Original line number Diff line number Diff line
@@ -305,9 +305,6 @@ static jobject ImageDecoder_nDecodeBitmap(JNIEnv* env, jobject /*clazz*/, jlong
    }

    SkImageInfo bitmapInfo = decoder->getOutputInfo();
    if (decoder->opaque()) {
        bitmapInfo = bitmapInfo.makeAlphaType(kOpaque_SkAlphaType);
    }
    if (asAlphaMask && colorType == kGray_8_SkColorType) {
        bitmapInfo = bitmapInfo.makeColorType(kAlpha_8_SkColorType);
    }