Hook up SkHeifCodec for ImageDecoder animation
bug: 78868457
bug: 120414514
test: local test with OpenGL Rendrerer Tests animation
demo and heifs files
Change-Id: I09a7667a57f545927dbe9ac24c1a6b405ff0006d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232839
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Chong Zhang <chz@google.com>
diff --git a/src/codec/SkStubHeifDecoderAPI.h b/src/codec/SkStubHeifDecoderAPI.h
index 87bfbae..4f93609 100644
--- a/src/codec/SkStubHeifDecoderAPI.h
+++ b/src/codec/SkStubHeifDecoderAPI.h
@@ -32,6 +32,7 @@
};
struct HeifFrameInfo {
+#ifdef SK_LEGACY_HEIF_API
int mRotationAngle;
int mWidth;
int mHeight;
@@ -39,6 +40,14 @@
size_t mIccSize;
std::unique_ptr<char[]> mIccData;
+#else
+ uint32_t mWidth;
+ uint32_t mHeight;
+ int32_t mRotationAngle; // Rotation angle, clockwise, should be multiple of 90
+ uint32_t mBytesPerPixel; // Number of bytes for one pixel
+ int64_t mDurationUs; // Duration of the frame in us
+ std::vector<uint8_t> mIccData; // ICC data array
+#endif
};
struct HeifDecoder {
@@ -47,10 +56,22 @@
return false;
}
+#ifndef SK_LEGACY_HEIF_API
+ bool getSequenceInfo(HeifFrameInfo* frameInfo, size_t *frameCount) {
+ return false;
+ }
+#endif
+
bool decode(HeifFrameInfo*) {
return false;
}
+#ifndef SK_LEGACY_HEIF_API
+ bool decodeSequence(int frameIndex, HeifFrameInfo* frameInfo) {
+ return false;
+ }
+#endif
+
bool setOutputColor(HeifColorFormat) {
return false;
}