Issue #1769 - Follow-up: Default-enable JPEG-XL images if built

Sets the pref default to true and also add conneg entry for images
if jxl support is built.
Additionally, ifdefs the GfxPref to only observe when jxl is built.
This commit is contained in:
Moonchild 2022-11-10 20:24:24 +00:00 committed by roytam1
commit 7f87cc1276
2 changed files with 7 additions and 1 deletions

View file

@ -448,7 +448,9 @@ private:
DECL_GFX_PREF(Live, "image.mozsamplesize.enabled", ImageMozSampleSizeEnabled, bool, false);
DECL_GFX_PREF(Once, "image.multithreaded_decoding.limit", ImageMTDecodingLimit, int32_t, -1);
DECL_GFX_PREF(Live, "image.webp.enabled", ImageWebPEnabled, bool, true);
#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);

View file

@ -4202,7 +4202,11 @@ pref("image.decode-immediately.enabled", false);
pref("image.downscale-during-decode.enabled", true);
// The default Accept header sent for images loaded over HTTP(S)
#ifdef MOZ_JXL
pref("image.http.accept", "image/webp,image/jxl,image/png,image/*;q=0.8,*/*;q=0.5");
#else
pref("image.http.accept", "image/webp,image/png,image/*;q=0.8,*/*;q=0.5");
#endif
// The threshold for inferring that changes to an <img> element's |src|
// attribute by JavaScript represent an animation, in milliseconds. If the |src|
@ -4263,7 +4267,7 @@ pref("image.multithreaded_decoding.limit", -1);
pref("image.webp.enabled", true);
#ifdef MOZ_JXL
pref("image.jxl.enabled", false);
pref("image.jxl.enabled", true);
#endif
// Limit for the canvas image cache. 0 means we don't limit the size of the