summaryrefslogtreecommitdiff
path: root/image/DecoderFactory.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-11-12 18:34:07 +0000
committerMoonchild <moonchild@palemoon.org>2022-11-12 18:34:07 +0000
commit31308126938487207d675825f04f265f37b3d4fa (patch)
tree59c0cb6fc945af9ff7264c472f8c3116d4c0eee3 /image/DecoderFactory.cpp
parent71ae69aea85ec8ddb9bf7baa93ae3926990a3693 (diff)
parentfb0c204f2b59485e796b93ce89f73af552b05c2b (diff)
downloaduxp-31308126938487207d675825f04f265f37b3d4fa.tar.gz
Merge branch 'master' into release
Diffstat (limited to 'image/DecoderFactory.cpp')
-rw-r--r--image/DecoderFactory.cpp14
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");
}