diff options
Diffstat (limited to 'image/DecoderFactory.cpp')
-rw-r--r-- | image/DecoderFactory.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp index dffe4dc211..303cd3d63b 100644 --- a/image/DecoderFactory.cpp +++ b/image/DecoderFactory.cpp @@ -19,6 +19,9 @@ #include "nsICODecoder.h" #include "nsIconDecoder.h" #include "nsWebPDecoder.h" +#ifdef MOZ_JXL +# include "nsJXLDecoder.h" +#endif namespace mozilla { @@ -77,6 +80,12 @@ DecoderFactory::GetDecoderType(const char* aMimeType) gfxPrefs::ImageWebPEnabled()) { type = DecoderType::WEBP; } +#ifdef MOZ_JXL + else if (!strcmp(aMimeType, IMAGE_JXL) && + gfxPrefs::ImageJXLEnabled()) { + type = DecoderType::JXL; + } +#endif return type; } @@ -116,6 +125,11 @@ DecoderFactory::GetDecoder(DecoderType aType, case DecoderType::WEBP: decoder = new nsWebPDecoder(aImage); break; +#ifdef MOZ_JXL + case DecoderType::JXL: + decoder = new nsJXLDecoder(aImage); + break; +#endif default: MOZ_ASSERT_UNREACHABLE("Unknown decoder type"); } |