summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2021-04-26 15:35:56 -0400
committerLeon Scroggins III <scroggo@google.com>2021-04-26 15:35:56 -0400
commitdf33b95e682711881325aaa080d3347f26f9c74c (patch)
treecf08f4256cd413bf01e9a21e440d4b2825138519 /native
parent43cc358fa0b5740d53a969d041808803e3029fa1 (diff)
AImageDecoder: only support animation for F16 and 8888 (impl)
Bug: 180594747 Test: I51dedd94aa8ff5d6846cada96861ffca30d509d7 See I03818703dc79942be4e574db31c6e2927ab571ed Change-Id: Ibce55e4af38713d2e40fcb8846d9d7a939367fd6
Diffstat (limited to 'native')
-rw-r--r--native/graphics/jni/imagedecoder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/native/graphics/jni/imagedecoder.cpp b/native/graphics/jni/imagedecoder.cpp
index 385e455e3e1f..b0c8c612036a 100644
--- a/native/graphics/jni/imagedecoder.cpp
+++ b/native/graphics/jni/imagedecoder.cpp
@@ -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;
}