diff options
author | Leon Scroggins <scroggo@google.com> | 2021-04-27 19:22:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-27 19:22:23 +0000 |
commit | bc4e5c6c6682ba92ead6fae23741ef76fb9ddb62 (patch) | |
tree | cce0de97bbd5daaac54c5a830a8fe560cfd546fc /native | |
parent | 33866688e60f7313b34b9431fbdc2f1d1d845a87 (diff) | |
parent | df33b95e682711881325aaa080d3347f26f9c74c (diff) |
Merge "AImageDecoder: only support animation for F16 and 8888 (impl)" into sc-dev
Diffstat (limited to 'native')
-rw-r--r-- | native/graphics/jni/imagedecoder.cpp | 9 |
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; } |