AImageDecoder: only support animation for F16 and 8888 (impl)

Bug: 180594747
Test: I51dedd94aa8ff5d6846cada96861ffca30d509d7

See I03818703dc79942be4e574db31c6e2927ab571ed

Change-Id: Ibce55e4af38713d2e40fcb8846d9d7a939367fd6
This commit is contained in:
Leon Scroggins III
2021-04-26 15:35:56 -04:00
parent 43cc358fa0
commit df33b95e68

View File

@@ -442,6 +442,15 @@ int AImageDecoder_advanceFrame(AImageDecoder* decoder) {
return ANDROID_IMAGE_DECODER_BAD_PARAMETER;
}
const auto colorType = imageDecoder->getOutputInfo().colorType();
switch (colorType) {
case kN32_SkColorType:
case kRGBA_F16_SkColorType:
break;
default:
return ANDROID_IMAGE_DECODER_INVALID_STATE;
}
if (imageDecoder->advanceFrame()) {
return ANDROID_IMAGE_DECODER_SUCCESS;
}