[webkit-changes] [WebKit/WebKit] 19b823: [JPEGXL] [Cocoa] Hook up color conversion to downl...
Myles C. Maxfield
noreply at github.com
Thu Jun 22 20:12:02 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 19b823079b6db3f9210dcc7e4034e0c2d317b92a
https://github.com/WebKit/WebKit/commit/19b823079b6db3f9210dcc7e4034e0c2d317b92a
Author: Myles C. Maxfield <mmaxfield at apple.com>
Date: 2023-06-22 (Thu, 22 Jun 2023)
Changed paths:
M Source/WebCore/PAL/pal/spi/cocoa/AppleJPEGXL/AppleJPEGXLSPI.h
M Source/WebCore/platform/graphics/PixelBufferConversion.cpp
M Source/WebCore/platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp
M Source/WebCore/platform/image-decoders/jpegxl/JPEGXLImageDecoder.h
M WebKitLibraries/DownlevelFrameworkStubs/120000/AppleJPEGXL.framework/AppleJPEGXL.tbd
M WebKitLibraries/DownlevelFrameworkStubs/130000/AppleJPEGXL.framework/AppleJPEGXL.tbd
Log Message:
-----------
[JPEGXL] [Cocoa] Hook up color conversion to downlevel JPEG XL infrastructure
https://bugs.webkit.org/show_bug.cgi?id=258267
rdar://111012276
Reviewed by Cameron McCormack and Don Olmstead.
The existing JPEG XL infrastructure on downlevel builds uses the "little cms" library
from https://github.com/LuaDist/lcms/tree/master to perform color conversions. However,
on Cocoa platforms, we already have color conversion support in the platform. This
patch hooks up the existing colorspace conversion functionality in
PixelBufferConversion.cpp instead of the little cms library.
The existing infrastructure only works with RGBA8 sRGB images, so configuring all
the converters is actually pretty straightforward.
This patch isn't testable, because AppleJPEGXL will only be present in builds produced
by Apple's internal build system, but our testers use local builds to test with. I had
to verify manually that this patch is working correctly.
* Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:
* Source/WebCore/PAL/pal/cocoa/VImageConverterPtr.h: Added.
(VImageConverterRefDerefTraits::refIfNotNull):
(VImageConverterRefDerefTraits::derefIfNotNull):
(adoptVImageConverter):
* Source/WebCore/PAL/pal/spi/cocoa/AppleJPEGXL/AppleJPEGXLSPI.h:
* Source/WebCore/platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp:
(WebCore::JPEGXLImageDecoder::clear):
(WebCore::JPEGXLImageDecoder::processInput):
(WebCore::JPEGXLImageDecoder::imageOut):
(WebCore::JPEGXLImageDecoder::maybePerformColorSpaceConversion):
(WebCore::JPEGXLImageDecoder::clearColorTransform):
(WebCore::JPEGXLImageDecoder::prepareColorTransform):
(WebCore::JPEGXLImageDecoder::tryDecodeICCColorProfile):
* Source/WebCore/platform/image-decoders/jpegxl/JPEGXLImageDecoder.h:
* WebKitLibraries/DownlevelFrameworkStubs/120000/AppleJPEGXL.framework/AppleJPEGXL.tbd:
* WebKitLibraries/DownlevelFrameworkStubs/130000/AppleJPEGXL.framework/AppleJPEGXL.tbd:
Canonical link: https://commits.webkit.org/265440@main
More information about the webkit-changes
mailing list