-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Cocoa] Support AVIF images for macOS Ventura and iOS 16 #1717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ constexpr ComparableCaseFoldingASCIILiteral supportedImageMIMETypeArray[] = { | |
#if USE(CG) || ENABLE(APNG) | ||
"image/apng", | ||
#endif | ||
#if USE(AVIF) | ||
#if HAVE(AVIF) || USE(AVIF) | ||
|
||
"image/avif", | ||
#endif | ||
"image/bmp", | ||
|
@@ -133,7 +133,7 @@ constexpr ComparableCaseFoldingASCIILiteral supportedImageMIMETypeArray[] = { | |
#if PLATFORM(IOS_FAMILY) | ||
"image/vnd.switfview-jpeg", | ||
#endif | ||
#if (USE(CG) && HAVE(WEBP)) || (!USE(CG) && USE(WEBP)) | ||
#if HAVE(WEBP) || USE(WEBP) | ||
shallawa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"image/webp", | ||
#endif | ||
#if PLATFORM(IOS_FAMILY) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ static RetainPtr<CFMutableDictionaryRef> createImageSourceOptions() | |
CFDictionarySetValue(options.get(), kCGImageSourceUseHardwareAcceleration, kCFBooleanFalse); | ||
|
||
#if HAVE(IMAGE_RESTRICTED_DECODING) && USE(APPLE_INTERNAL_SDK) | ||
if (ImageDecoderCG::decodingHEICEnabled()) | ||
if (ImageDecoderCG::decodingHEICEnabled() || ImageDecoderCG::decodingAVIFEnabled()) | ||
CFDictionarySetValue(options.get(), kCGImageSourceEnableRestrictedDecoding, kCFBooleanTrue); | ||
|
||
#endif | ||
|
||
|
@@ -269,6 +269,7 @@ void sharedBufferRelease(void* info) | |
#endif | ||
|
||
bool ImageDecoderCG::s_enableDecodingHEIC = false; | ||
bool ImageDecoderCG::s_enableDecodingAVIF = false; | ||
bool ImageDecoderCG::s_hardwareAcceleratedDecodingDisabled = false; | ||
|
||
ImageDecoderCG::ImageDecoderCG(FragmentedSharedBuffer& data, AlphaOption, GammaAndColorProfileOption) | ||
|
@@ -621,6 +622,16 @@ bool ImageDecoderCG::decodingHEICEnabled() | |
return s_enableDecodingHEIC; | ||
} | ||
|
||
void ImageDecoderCG::enableDecodingAVIF() | ||
{ | ||
s_enableDecodingAVIF = true; | ||
} | ||
|
||
bool ImageDecoderCG::decodingAVIFEnabled() | ||
{ | ||
return s_enableDecodingAVIF; | ||
} | ||
|
||
void ImageDecoderCG::disableHardwareAcceleratedDecoding() | ||
{ | ||
s_hardwareAcceleratedDecodingDisabled = true; | ||
|
Uh oh!
There was an error while loading. Please reload this page.