Merge "AImageDecoder: Suppress log messages" into rvc-dev am: 0a5b54560d am: ddc948b4c1 am: eca013d418
Change-Id: I5ca6a2de204765c63da593a841d5eaa023b170f4
This commit is contained in:
@@ -50,10 +50,8 @@ ImageDecoder::ImageDecoder(std::unique_ptr<SkAndroidCodec> codec, sk_sp<SkPngChu
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkAlphaType ImageDecoder::getOutAlphaType() const {
|
SkAlphaType ImageDecoder::getOutAlphaType() const {
|
||||||
// While an SkBitmap may want to use kOpaque_SkAlphaType for a performance
|
return opaque() ? kOpaque_SkAlphaType
|
||||||
// optimization, this class just outputs raw pixels. Using either
|
: mUnpremultipliedRequired ? kUnpremul_SkAlphaType : kPremul_SkAlphaType;
|
||||||
// premultiplication choice has no effect on decoding an opaque encoded image.
|
|
||||||
return mUnpremultipliedRequired ? kUnpremul_SkAlphaType : kPremul_SkAlphaType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImageDecoder::setTargetSize(int width, int height) {
|
bool ImageDecoder::setTargetSize(int width, int height) {
|
||||||
@@ -82,8 +80,7 @@ bool ImageDecoder::setTargetSize(int width, int height) {
|
|||||||
SkISize targetSize = { width, height }, decodeSize = targetSize;
|
SkISize targetSize = { width, height }, decodeSize = targetSize;
|
||||||
int sampleSize = mCodec->computeSampleSize(&decodeSize);
|
int sampleSize = mCodec->computeSampleSize(&decodeSize);
|
||||||
|
|
||||||
if (decodeSize != targetSize && mUnpremultipliedRequired
|
if (decodeSize != targetSize && mUnpremultipliedRequired && !opaque()) {
|
||||||
&& !mCodec->getInfo().isOpaque()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -305,9 +305,6 @@ static jobject ImageDecoder_nDecodeBitmap(JNIEnv* env, jobject /*clazz*/, jlong
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkImageInfo bitmapInfo = decoder->getOutputInfo();
|
SkImageInfo bitmapInfo = decoder->getOutputInfo();
|
||||||
if (decoder->opaque()) {
|
|
||||||
bitmapInfo = bitmapInfo.makeAlphaType(kOpaque_SkAlphaType);
|
|
||||||
}
|
|
||||||
if (asAlphaMask && colorType == kGray_8_SkColorType) {
|
if (asAlphaMask && colorType == kGray_8_SkColorType) {
|
||||||
bitmapInfo = bitmapInfo.makeColorType(kAlpha_8_SkColorType);
|
bitmapInfo = bitmapInfo.makeColorType(kAlpha_8_SkColorType);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user