gecko-dev/image/test/gtest
Chun-Min Chang b7811b117b Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman
This patch implements the transparency support for AVIF image files.

To convert the decoded YCbCr and Alpha data to RGBA, a function named
`ConvertYCbCrAToARGB` is created to do this job in the following
procedure:

ConvertYCbCrAToARGB:
  If the layout of the YCbCr is I420
    Calling libyuv::I420AlphaToARGB
  Else
    Fill RGB data converted by ConvertYCbCrToRGB in ARGB buffer first
    Insert the alpha data to ARGB buffer

On the other hand, this patch refactors the nsAVIFDecoder a bit to make
the lifetime of the parsed data and decoded image data clearer. They
won't live longer than Parser object and {Dav1d, AOM}Decoder object.
This should improve the code readability.

This patch also adds a transparent image test (TransparentAVIFTestCase)
to check the FLAG_HAS_TRANSPARENCY is posted or not. The test image file
`transparent.avif` is from Bug 1654462.

Differential Revision: https://phabricator.services.mozilla.com/D98951
2020-12-16 01:27:14 +00:00
..
Common.cpp Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman 2020-12-16 01:27:14 +00:00
Common.h Bug 1621283 - Ensure the WebP image decoder can handle source buffer errors. r=tnikkel 2020-05-27 22:52:10 +00:00
TestADAM7InterpolatingFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestAnimationFrameBuffer.cpp Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj 2020-01-20 16:19:48 +00:00
TestBlendAnimationFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestContainers.cpp
TestCopyOnWrite.cpp
TestDecodeToSurface.cpp Bug 1631615 - Don't color manage PNG/JPG/WebP if not tagged. r=tnikkel 2020-05-04 21:51:25 +00:00
TestDecoders.cpp Bug 1660470 - Add missing include directives/forward declarations. r=nika 2020-11-23 16:21:38 +00:00
TestDecodersPerf.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestDeinterlacingFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestDownscalingFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestDownscalingFilterNoSkia.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestFrameAnimator.cpp Bug 1620600 - Add flags to allow image decoders to produce sRGB output. r=tnikkel 2020-04-10 16:26:33 +00:00
TestLoader.cpp Bug 1656927 - Assertion failure: aContentType.Equals("image/avif"), at /builds/worker/checkouts/gecko/image/imgLoader.cpp:2785. r=aosmond 2020-08-04 17:30:14 +00:00
TestMetadata.cpp Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman 2020-12-16 01:27:14 +00:00
TestRemoveFrameRectFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestSourceBuffer.cpp Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj 2020-01-20 16:19:48 +00:00
TestStreamingLexer.cpp
TestSurfaceCache.cpp
TestSurfacePipeIntegration.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestSurfaceSink.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
TestSwizzleFilter.cpp Bug 1625770 - Qualify image::Decoder in image gtests, r=tnikkel 2020-03-30 13:09:51 +00:00
animated-with-extra-image-sub-blocks.gif
blend.gif
blend.png
blend.webp
bug-1655846.avif Bug 1655846 - Hit MOZ_CRASH(assertion failed: `(left == right)` left: `1024`, right: `0`). r=tnikkel 2020-08-14 23:17:37 +00:00
corrupt-with-bad-bmp-height.ico
corrupt-with-bad-bmp-width.ico
corrupt-with-bad-ico-bpp.ico
corrupt.jpg
downscaled.avif Bug 1625363 - AVIF (AV1 Image File Format): experimental support. r=aosmond,necko-reviewers,valentin 2020-05-01 22:56:04 +00:00
downscaled.bmp
downscaled.gif
downscaled.ico
downscaled.icon
downscaled.jpg
downscaled.png
downscaled.webp
first-frame-green.gif
first-frame-green.png
first-frame-green.webp
first-frame-padding.gif
green-1x1-truncated.gif
green-large-bmp.ico
green-large-png.ico
green-multiple-sizes.ico
green.avif Bug 1625363 - AVIF (AV1 Image File Format): experimental support. r=aosmond,necko-reviewers,valentin 2020-05-01 22:56:04 +00:00
green.bmp
green.gif
green.icc_srgb.webp
green.ico
green.icon Bug 1620600 - Add flags to allow image decoders to produce sRGB output. r=tnikkel 2020-04-10 16:26:33 +00:00
green.jpg
green.png
green.webp
invalid-truncated-metadata.bmp
large.avif Bug 1625363 - AVIF (AV1 Image File Format): experimental support. r=aosmond,necko-reviewers,valentin 2020-05-01 22:56:04 +00:00
large.webp
moz.build Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman 2020-12-16 01:27:14 +00:00
multilayer.avif Bug 1669033 - dav1d all_layers setting should be set to 0. r=aosmond 2020-10-08 00:56:38 +00:00
no-frame-delay.gif
perf_cmyk.jpg
perf_gray.jpg
perf_gray.png
perf_gray_alpha.png
perf_srgb.gif
perf_srgb.png
perf_srgb_alpha.png
perf_srgb_alpha_lossless.webp
perf_srgb_alpha_lossy.webp
perf_srgb_lossless.webp
perf_srgb_lossy.webp
perf_ycbcr.jpg
rle4.bmp
rle8.bmp
stackcheck.avif Bug 1639409 - AVIF (AV1 Image File Format): decode with dav1d. r=aosmond 2020-05-22 19:00:17 +00:00
transparent-ico-with-and-mask.ico
transparent-if-within-ico.bmp
transparent-no-alpha-header.webp
transparent.avif Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman 2020-12-16 01:27:14 +00:00
transparent.gif
transparent.png
transparent.webp