10#ifdef SK_CODEC_DECODES_AVIF
23 int expectedFrameCount;
24 int expectedFrameDuration;
32 ERRORF(r,
"failed to find %s", t.path);
38 ERRORF(r,
"Could not create codec from %s", t.path);
43 auto info = codec->getInfo();
52 for (
int i = 0;
i < codec->getFrameCount();
i++) {
58 "Failed to decode %s frame %i - error %s",
65 if (codec->getFrameCount() > 1) {
67 if (!codec->getFrameInfo(
i, &frameInfo)) {
68 ERRORF(r,
"Failed to getFrameInfo for %s frame %i", t.path,
i);
78 AvifTestCase t = {.path =
"images/dog.avif",
83 .expectedFrameCount = 1,
84 .expectedFrameDuration = 0,
90DEF_TEST(AvifDecodeOddDimensions, r) {
91 AvifTestCase t = {.path =
"images/ducky.avif",
96 .expectedFrameCount = 1,
97 .expectedFrameDuration = 0,
104 AvifTestCase t = {.path =
"images/dog.avif",
109 .expectedFrameCount = 1,
110 .expectedFrameDuration = 0,
116DEF_TEST(AvifDecode10BitToRGBA8888Bitmap, r) {
117 AvifTestCase t = {.path =
"images/example_3_10bit.avif",
122 .expectedFrameCount = 1,
123 .expectedFrameDuration = 0,
129DEF_TEST(AvifDecode10BitToRGBAF16Bitmap, r) {
130 AvifTestCase t = {.path =
"images/example_3_10bit.avif",
135 .expectedFrameCount = 1,
136 .expectedFrameDuration = 0,
142DEF_TEST(AvifDecode10BitToRGBAF16BitmapDownscale, r) {
143 AvifTestCase t = {.path =
"images/example_3_10bit.avif",
148 .expectedFrameCount = 1,
149 .expectedFrameDuration = 0,
155DEF_TEST(AvifDecode12BitToRGBA8888Bitmap, r) {
156 AvifTestCase t = {.path =
"images/example_3_12bit.avif",
161 .expectedFrameCount = 1,
162 .expectedFrameDuration = 0,
168DEF_TEST(AvifDecode12BitToRGBAF16Bitmap, r) {
169 AvifTestCase t = {.path =
"images/example_3_12bit.avif",
174 .expectedFrameCount = 1,
175 .expectedFrameDuration = 0,
181DEF_TEST(AvifDecode12BitToRGBAF16BitmapDownscale, r) {
182 AvifTestCase t = {.path =
"images/example_3_12bit.avif",
187 .expectedFrameCount = 1,
188 .expectedFrameDuration = 0,
194DEF_TEST(AvifDecodeImageWithAlpha, r) {
195 AvifTestCase t = {.path =
"images/baby_tux.avif",
200 .expectedFrameCount = 1,
201 .expectedFrameDuration = 0,
208 AvifTestCase t = {.path =
"images/alphabetAnim.avif",
213 .expectedFrameCount = 13,
214 .expectedFrameDuration = 100,
220DEF_TEST(AvifDecodeAnimationWithAlpha, r) {
221 AvifTestCase t = {.path =
"images/example_1_animated.avif",
226 .expectedFrameCount = 8,
227 .expectedFrameDuration = 33,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
sk_sp< SkData > GetResourceAsData(const char *resource)
@ kOpaque_SkAlphaType
pixel is opaque
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
static std::unique_ptr< SkCodec > MakeFromData(sk_sp< SkData >, SkSpan< const SkCodecs::Decoder > decoders, SkPngChunkReader *=nullptr)
static const char * ResultToString(Result)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static const int imageHeight
static const int imageWidth
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
std::shared_ptr< const fml::Mapping > data