зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset fd4e161666b0 (bug 1641389) for build bustages on nsImageModule.cpp. CLOSED TREE
This commit is contained in:
Родитель
0e4015ecb8
Коммит
09cc85b802
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "nsMimeTypes.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/StaticPrefs_image.h"
|
||||
|
||||
#include "AnimationSurfaceProvider.h"
|
||||
#include "Decoder.h"
|
||||
|
@ -77,7 +76,8 @@ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
|
|||
type = DecoderType::ICON;
|
||||
|
||||
// WebP
|
||||
} else if (!strcmp(aMimeType, IMAGE_WEBP)) {
|
||||
} else if (!strcmp(aMimeType, IMAGE_WEBP) &&
|
||||
StaticPrefs::image_webp_enabled()) {
|
||||
type = DecoderType::WEBP;
|
||||
|
||||
// AVIF
|
||||
|
|
|
@ -36,8 +36,12 @@ AutoInitializeImageLib::AutoInitializeImageLib() {
|
|||
EXPECT_TRUE(NS_IsMainThread());
|
||||
sImageLibInitialized = true;
|
||||
|
||||
// Ensure WebP is enabled to run decoder tests.
|
||||
nsresult rv = Preferences::SetBool("image.webp.enabled", true);
|
||||
EXPECT_TRUE(rv == NS_OK);
|
||||
|
||||
// Ensure AVIF is enabled to run decoder tests.
|
||||
nsresult rv = Preferences::SetBool("image.avif.enabled", true);
|
||||
rv = Preferences::SetBool("image.avif.enabled", true);
|
||||
EXPECT_TRUE(rv == NS_OK);
|
||||
|
||||
// Ensure that ImageLib services are initialized.
|
||||
|
|
|
@ -159,7 +159,7 @@ function runTests()
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.requestFlakyTimeout("untriaged");
|
||||
|
||||
runTests();
|
||||
SpecialPowers.pushPrefEnv({"set": [["image.webp.enabled", true]]}, runTests);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
|
|
@ -37,7 +37,8 @@ var gNumDiscards = 0;
|
|||
window.onload = function() {
|
||||
// Enable discarding for the test.
|
||||
SpecialPowers.pushPrefEnv({
|
||||
'set':[['image.mem.discardable',true]]
|
||||
'set':[['image.mem.discardable',true],
|
||||
['image.webp.enabled',true]]
|
||||
}, runTest);
|
||||
}
|
||||
|
||||
|
|
|
@ -4589,6 +4589,12 @@
|
|||
value: -1
|
||||
mirror: once
|
||||
|
||||
# Whether we attempt to decode WebP images or not.
|
||||
- name: image.webp.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Whether we attempt to decode AVIF images or not.
|
||||
- name: image.avif.enabled
|
||||
type: RelaxedAtomicBool
|
||||
|
|
Загрузка…
Ссылка в новой задаче