Issue #2739 - Default-enable libjxl and image/jxl format
This removes the build option and pref, supporting JPEG-XL as an ubiquitous format for all UXP applications. Resolves #2739
This commit is contained in:
8 files changed
+7
-53
No files matched your search
Vendored
+2
-3
@@ -41,12 +41,11 @@ if CONFIG['CPU_ARCH'] == 'arm':
|
||||
if CONFIG['MOZ_FFVPX']:
|
||||
external_dirs += ['media/ffvpx']
|
||||
|
||||
if CONFIG["MOZ_JXL"]:
|
||||
external_dirs += ["media/libjxl", "media/highway"]
|
||||
|
||||
external_dirs += [
|
||||
'media/highway',
|
||||
'media/kiss_fft',
|
||||
'media/libcubeb',
|
||||
'media/libjxl',
|
||||
'media/libnestegg',
|
||||
'media/libogg',
|
||||
'media/libopus',
|
||||
|
||||
@@ -447,9 +447,6 @@ private:
|
||||
DECL_GFX_PREF(Once, "image.mem.surfacecache.min_expiration_ms", ImageMemSurfaceCacheMinExpirationMS, uint32_t, 60*1000);
|
||||
DECL_GFX_PREF(Once, "image.mem.surfacecache.size_factor", ImageMemSurfaceCacheSizeFactor, uint32_t, 64);
|
||||
DECL_GFX_PREF(Once, "image.multithreaded_decoding.limit", ImageMTDecodingLimit, int32_t, -1);
|
||||
#ifdef MOZ_JXL
|
||||
DECL_GFX_PREF(Live, "image.jxl.enabled", ImageJXLEnabled, bool, true);
|
||||
#endif
|
||||
|
||||
DECL_GFX_PREF(Once, "layers.acceleration.enabled", LayersAccelerationEnabledDoNotUseDirectly, bool, true);
|
||||
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps", LayersDrawFPS, bool, false);
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
#include "nsICODecoder.h"
|
||||
#include "nsIconDecoder.h"
|
||||
#include "nsWebPDecoder.h"
|
||||
#ifdef MOZ_JXL
|
||||
# include "nsJXLDecoder.h"
|
||||
#endif
|
||||
#include "nsJXLDecoder.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -79,13 +77,10 @@ DecoderFactory::GetDecoderType(const char* aMimeType)
|
||||
} else if (!strcmp(aMimeType, IMAGE_WEBP)) {
|
||||
type = DecoderType::WEBP;
|
||||
}
|
||||
#ifdef MOZ_JXL
|
||||
// JPEG-XL
|
||||
else if (!strcmp(aMimeType, IMAGE_JXL) &&
|
||||
gfxPrefs::ImageJXLEnabled()) {
|
||||
else if (!strcmp(aMimeType, IMAGE_JXL)) {
|
||||
type = DecoderType::JXL;
|
||||
}
|
||||
#endif
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -125,11 +120,9 @@ 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");
|
||||
}
|
||||
@@ -203,10 +196,8 @@ DecoderFactory::CreateAnimationDecoder(DecoderType aType,
|
||||
bool validDecoderType = (
|
||||
aType == DecoderType::GIF ||
|
||||
aType == DecoderType::PNG ||
|
||||
aType == DecoderType::WEBP);
|
||||
#ifdef MOZ_JXL
|
||||
validDecoderType = validDecoderType || aType == DecoderType::JXL;
|
||||
#endif
|
||||
aType == DecoderType::WEBP ||
|
||||
aType == DecoderType::JXL);
|
||||
|
||||
MOZ_ASSERT(validDecoderType,
|
||||
"Calling CreateAnimationDecoder for non-animating DecoderType");
|
||||
|
||||
@@ -24,15 +24,11 @@ UNIFIED_SOURCES += [
|
||||
'nsICODecoder.cpp',
|
||||
'nsIconDecoder.cpp',
|
||||
'nsJPEGDecoder.cpp',
|
||||
'nsJXLDecoder.cpp',
|
||||
'nsPNGDecoder.cpp',
|
||||
'nsWebPDecoder.cpp',
|
||||
]
|
||||
|
||||
if CONFIG["MOZ_JXL"]:
|
||||
UNIFIED_SOURCES += [
|
||||
"nsJXLDecoder.cpp",
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
||||
@@ -81,7 +81,6 @@ aom_codec_peek_stream_info
|
||||
aom_img_alloc
|
||||
aom_img_free
|
||||
#endif
|
||||
#ifdef MOZ_JXL
|
||||
JxlDecoderCreate
|
||||
JxlDecoderDestroy
|
||||
JxlDecoderSetParallelRunner
|
||||
@@ -98,7 +97,6 @@ JxlThreadParallelRunner
|
||||
JxlThreadParallelRunnerCreate
|
||||
JxlThreadParallelRunnerDestroy
|
||||
JxlThreadParallelRunnerDefaultNumWorkerThreads
|
||||
#endif
|
||||
#ifdef MOZ_VORBIS
|
||||
ogg_page_bos
|
||||
ogg_page_granulepos
|
||||
|
||||
@@ -1467,16 +1467,8 @@ pref("network.http.request.max-attempts", 10);
|
||||
pref("network.http.accept.default", "*/*");
|
||||
// Top-level navigation should include all non-ubiquitous mime types in front of */*
|
||||
// including image and video/audio types that are handled top-level.
|
||||
#ifdef MOZ_JXL
|
||||
pref("network.http.accept.navigation", "text/html,application/xhtml+xml,application/xml;q=0.9,image/jxl,image/webp,image/apng,video/x-matroska,video/webm,*/*;q=0.8");
|
||||
#else
|
||||
pref("network.http.accept.navigation", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,video/x-matroska,video/webm,*/*;q=0.8");
|
||||
#endif
|
||||
#ifdef MOZ_JXL
|
||||
pref("network.http.accept.image", "image/jxl,image/webp,image/apng,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5");
|
||||
#else
|
||||
pref("network.http.accept.image", "image/webp,image/apng,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5");
|
||||
#endif
|
||||
pref("network.http.accept.style", "text/css,*/*;q=0.1");
|
||||
|
||||
// Prefs allowing granular control of referers
|
||||
|
||||
@@ -2006,7 +2006,6 @@ MOZ_FEEDS=1
|
||||
MOZ_AUTH_EXTENSION=1
|
||||
MOZ_RAW=
|
||||
MOZ_AV1=
|
||||
MOZ_JXL=
|
||||
MOZ_VORBIS=
|
||||
MOZ_TREMOR=
|
||||
MOZ_SAMPLE_TYPE_FLOAT32=
|
||||
@@ -2820,20 +2819,6 @@ fi
|
||||
|
||||
AC_SUBST(MOZ_AV1)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable JPEG-XL Codec
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(jxl,
|
||||
[ --enable-jxl Enable libjxl and highway for jxl image support],
|
||||
MOZ_JXL=1,
|
||||
MOZ_JXL=)
|
||||
|
||||
if test -n "$MOZ_JXL"; then
|
||||
AC_DEFINE(MOZ_JXL)
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_JXL)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Apple platform decoder support
|
||||
dnl ========================================================
|
||||
|
||||
@@ -425,9 +425,7 @@ static const nsDefaultMimeTypeEntry defaultMimeEntries[] =
|
||||
{ TEXT_CSS, "css" },
|
||||
{ IMAGE_JPEG, "jpeg" },
|
||||
{ IMAGE_JPEG, "jpg" },
|
||||
#ifdef MOZ_JXL
|
||||
{ IMAGE_JXL, "jxl" },
|
||||
#endif
|
||||
{ IMAGE_SVG_XML, "svg" },
|
||||
{ TEXT_HTML, "html" },
|
||||
{ TEXT_HTML, "htm" },
|
||||
@@ -500,9 +498,7 @@ static const nsExtraMimeTypeEntry extraMimeEntries[] =
|
||||
{ IMAGE_GIF, "gif", "GIF Image" },
|
||||
{ IMAGE_ICO, "ico,cur", "ICO Image" },
|
||||
{ IMAGE_JPEG, "jpeg,jpg,jfif,pjpeg,pjp", "JPEG Image" },
|
||||
#ifdef MOZ_JXL
|
||||
{ IMAGE_JXL, "jxl", "JPEG-XL Image" },
|
||||
#endif
|
||||
{ IMAGE_PNG, "png", "PNG Image" },
|
||||
{ IMAGE_APNG, "apng", "APNG Image" },
|
||||
{ IMAGE_TIFF, "tiff,tif", "TIFF Image" },
|
||||
|
||||
Reference in new issue
Block a user