haikuwebkit/LayoutTests/fast/images/avif-image-decoding-expecte...

3 lines
9 B
Plaintext
Raw Permalink Normal View History

AVIF decoding support https://bugs.webkit.org/show_bug.cgi?id=207750 Reviewed by Philippe Normand. This patch brings an initial support of AVIF image format to the gtk port. AVIF is a new royalty-free image format derived from the keyframes of AV1 video. FireFox and Chromium-variant browsers already support it. Its specification can be found at https://rawcdn.githack.com/AOMediaCodec/av1-avif/67a92add6cd642a8863e386fa4db87954a6735d1/index.html This patch aims to land a build option for AVIF and a basic decoding ability for still images by using libavif. Animated AVIF images will be covered later. .: * Source/cmake/FindAVIF.cmake: Added to find libavif. * Source/cmake/OptionsGTK.cmake: A build option, USE_AVIF is added. Source/WebCore: A mimetype and a decoder for AVIF are newly added. The new tests verify if an avif image can be decoded and properly rendered. Only the gtk port performs these tests for now. Tests: fast/images/avif-as-image.html fast/images/avif-image-decoding.html * PlatformGTK.cmake: Add AVIFImageDecoder.cpp and AVIFImageReader.cpp as build targets * platform/MIMETypeRegistry.cpp: avif mimetype added. (WebCore::MIMETypeRegistry::supportedImageMIMETypes): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::create): AVIF file signature added. * platform/image-decoders/avif/AVIFImageDecoder.cpp: Added. (WebCore::AVIFImageDecoder::AVIFImageDecoder): (WebCore::AVIFImageDecoder::frameBufferAtIndex): Decode a frame of avif image. The first frame is decoded for now. (WebCore::AVIFImageDecoder::setFailed): (WebCore::AVIFImageDecoder::tryDecodeSize): Parses header of avif images. (WebCore::AVIFImageDecoder::decode): * platform/image-decoders/avif/AVIFImageDecoder.h: Added. * platform/image-decoders/avif/AVIFImageReader.cpp: Added. (WebCore::AVIFImageReader::AVIFImageReader): (WebCore::AVIFImageReader::~AVIFImageReader): (WebCore::AVIFImageReader::parseHeader): Actual parsing of the header with libavif (WebCore::AVIFImageReader::decodeFrame): Actual decoding of an avif frame. * platform/image-decoders/avif/AVIFImageReader.h: Added. * platform/image-decoders/avif/AVIFUniquePtr.h: Added a smart pointer template for avifDecoder. (WebCore::AVIFPtrDeleter<avifDecoder>::operator() const): Tools: * gtk/install-dependencies: Add dependencies of libavif for jhbuild * gtk/jhbuild.modules: Add libavif for jhbuild LayoutTests: The new tests verify if an avif image can be decoded and properly rendered. Only the gtk port performs these tests for now. * TestExpectations: Skip avif tests for non-gtk ports * fast/images/avif-as-image-expected.html: Added. * fast/images/avif-as-image.html: Added. * fast/images/avif-image-decoding-expected.txt: Added. * fast/images/avif-image-decoding.html: Added. * fast/images/resources/green-313x313.avif: Added. * platform/gtk/TestExpectations: The gtk port should pass the tests. Canonical link: https://commits.webkit.org/234918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-05 16:15:08 +00:00
313x313