[webkit-changes] [WebKit/WebKit] 5300e6: [macOS Monterey and Big Sur] Enable AVIF image dec...

Myles C. Maxfield noreply at github.com
Tue Oct 25 14:37:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5300e66a81df105c2dd2aefe87f42e95a27c027d
      https://github.com/WebKit/WebKit/commit/5300e66a81df105c2dd2aefe87f42e95a27c027d
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2022-10-25 (Tue, 25 Oct 2022)

  Changed paths:
    M LayoutTests/platform/mac/TestExpectations
    M Source/WTF/wtf/PlatformUse.h
    M Source/WebCore/Configurations/WebCore.xcconfig
    M Source/WebCore/PAL/libavif/Configurations/libavif.xcconfig
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/ImageDecoder.cpp
    A Source/WebCore/platform/graphics/cg/ImageBackingStoreCG.cpp
    M Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
    M Source/WebCore/platform/graphics/cg/ImageDecoderCG.h
    M Source/WebCore/platform/graphics/cg/UTIRegistry.cpp
    M Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp
    M Source/WebCore/platform/image-decoders/avif/AVIFImageDecoder.h
    M Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp

  Log Message:
  -----------
  [macOS Monterey and Big Sur] Enable AVIF image decoding using libavif and dav1d
https://bugs.webkit.org/show_bug.cgi?id=246925
rdar://101481679

Reviewed by Said Abou-Hallawa.

We checked in libavif and dav1d sources in 494a012c9820b947bdad5b6b5ea95df04e5bb1fe.

This patch hooks up image decoding to use them, on macOS Monterey and Big Sur. It does
so by using the same glue code that non-Apple platforms use: ScalableImageDecoder and
AVIFImageDecoder. This patch includes those files in Sources.txt for all ports, and
refactors ScalableImageDecoder on Cocoa platforms to only support AVIF, as per
https://webkit.slack.com/archives/CU64U6FDW/p1666556573569359?thread_ts=1666555605.109619&cid=CU64U6FDW.

This patch re-uses the same USE(AVIF) flag that the non-Apple ports have been using.
There are currently 2 AVIF flags:
- USE(AVIF) indicates that libavif will be used to decode AVIF images, using the
      ScalableImageDecoder infrastructure. This is enabled on the non-Apple ports,
      and on macOS Monterey and Big Sur.
- HAVE(AVIF) indicates that the platform can decode AVIF images directly. This is enabled
      on macOS Ventura and later (and other Cocoa ports).
These flags are mutually exclusive; no port has both enabled at the same time. The Apple
Windows port has neither of these flags enabled.

* Source/WTF/wtf/PlatformUse.h:
* Source/WebCore/Configurations/WebCore.xcconfig:
* Source/WebCore/PAL/libavif/Configurations/libavif.xcconfig:
* Source/WebCore/Sources.txt:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
* Source/WebCore/platform/graphics/cg/ImageBackingStoreCG.cpp: Copied from Source/WebCore/platform/image-decoders/avif/AVIFImageDecoder.h.
(WebCore::ImageBackingStore::image const):
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::decodeUTI const):
(WebCore::ImageDecoderCG::decodeUTI):
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.h:
* Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::create):
* Source/WebCore/platform/image-decoders/avif/AVIFImageDecoder.h:
* Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:
(WebCore::AVIFImageReader::decodeFrame):

Canonical link: https://commits.webkit.org/255984@main




More information about the webkit-changes mailing list