commit | df33b95e682711881325aaa080d3347f26f9c74c | [log] [tgz] |
---|---|---|
author | Leon Scroggins III <scroggo@google.com> | Mon Apr 26 15:35:56 2021 -0400 |
committer | Leon Scroggins III <scroggo@google.com> | Mon Apr 26 15:35:56 2021 -0400 |
tree | cf08f4256cd413bf01e9a21e440d4b2825138519 | |
parent | 43cc358fa0b5740d53a969d041808803e3029fa1 [diff] [blame] |
AImageDecoder: only support animation for F16 and 8888 (impl) Bug: 180594747 Test: I51dedd94aa8ff5d6846cada96861ffca30d509d7 See I03818703dc79942be4e574db31c6e2927ab571ed Change-Id: Ibce55e4af38713d2e40fcb8846d9d7a939367fd6
diff --git a/native/graphics/jni/imagedecoder.cpp b/native/graphics/jni/imagedecoder.cpp index 385e455..b0c8c61 100644 --- a/native/graphics/jni/imagedecoder.cpp +++ b/native/graphics/jni/imagedecoder.cpp
@@ -442,6 +442,15 @@ 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; }