mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1919368. When constructing surface pipes for images downscaling must come after premultiplying alpha. r=gfx-reviewers,nical
The downscaling filter depends on operating on premultiplied alpha data. Differential Revision: https://phabricator.services.mozilla.com/D222597
This commit is contained in:
parent
8b1b75c739
commit
36a27965fb
@ -637,8 +637,8 @@ class SurfacePipeFactory {
|
||||
if (aOrientation.IsIdentity()) {
|
||||
if (colorManagement) {
|
||||
if (downscale) {
|
||||
pipe = MakePipe(downscalingConfig, colorManagementConfig,
|
||||
premultiplyConfig, surfaceConfig);
|
||||
pipe = MakePipe(colorManagementConfig, premultiplyConfig,
|
||||
downscalingConfig, surfaceConfig);
|
||||
} else { // (downscale is false)
|
||||
pipe = MakePipe(colorManagementConfig, premultiplyConfig,
|
||||
surfaceConfig);
|
||||
@ -646,7 +646,7 @@ class SurfacePipeFactory {
|
||||
} else { // (colorManagement is false)
|
||||
if (downscale) {
|
||||
pipe =
|
||||
MakePipe(downscalingConfig, premultiplyConfig, surfaceConfig);
|
||||
MakePipe(premultiplyConfig, downscalingConfig, surfaceConfig);
|
||||
} else { // (downscale is false)
|
||||
pipe = MakePipe(premultiplyConfig, surfaceConfig);
|
||||
}
|
||||
@ -654,15 +654,15 @@ class SurfacePipeFactory {
|
||||
} else { // (orientation is not identity)
|
||||
if (colorManagement) {
|
||||
if (downscale) {
|
||||
pipe = MakePipe(downscalingConfig, colorManagementConfig,
|
||||
premultiplyConfig, reorientSurfaceConfig);
|
||||
pipe = MakePipe(colorManagementConfig, premultiplyConfig,
|
||||
downscalingConfig, reorientSurfaceConfig);
|
||||
} else { // (downscale is false)
|
||||
pipe = MakePipe(colorManagementConfig, premultiplyConfig,
|
||||
reorientSurfaceConfig);
|
||||
}
|
||||
} else { // (colorManagement is false)
|
||||
if (downscale) {
|
||||
pipe = MakePipe(downscalingConfig, premultiplyConfig,
|
||||
pipe = MakePipe(premultiplyConfig, downscalingConfig,
|
||||
reorientSurfaceConfig);
|
||||
} else { // (downscale is false)
|
||||
pipe = MakePipe(premultiplyConfig, reorientSurfaceConfig);
|
||||
|
1
image/test/reftest/downscaling/1919368-1-ref.html
Normal file
1
image/test/reftest/downscaling/1919368-1-ref.html
Normal file
@ -0,0 +1 @@
|
||||
<img src="1919368-1.png" style="width: 700px; height: 308px;">
|
BIN
image/test/reftest/downscaling/1919368-1.avif
Normal file
BIN
image/test/reftest/downscaling/1919368-1.avif
Normal file
Binary file not shown.
1
image/test/reftest/downscaling/1919368-1.html
Normal file
1
image/test/reftest/downscaling/1919368-1.html
Normal file
@ -0,0 +1 @@
|
||||
<img src="1919368-1.avif" style="width: 700px; height: 308px;">
|
BIN
image/test/reftest/downscaling/1919368-1.png
Normal file
BIN
image/test/reftest/downscaling/1919368-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 583 B |
@ -110,6 +110,12 @@ fuzzy(0-1,0-1024) == downscale-32px.html?.jpg downscale-32px-ref.html
|
||||
# Test downscaling a JPEG with orientation metadata.
|
||||
fuzzy(0-1,0-50) == downscale-orient.html downscale-orient-ref.html
|
||||
|
||||
# be careful changing fuzzy, the bug this test is testing is if the shade of orange is too dark
|
||||
fuzzy(0-1,0-144) == 1919368-1.html 1919368-1-ref.html
|
||||
|
||||
|
||||
|
||||
|
||||
# RUN TESTS WITH DOWNSCALE-DURING-DECODE ENABLED:
|
||||
# ===============================================
|
||||
defaults pref(image.downscale-during-decode.enabled,true)
|
||||
@ -212,6 +218,9 @@ fuzzy(0-4,0-18) == downscale-orient.html downscale-orient-ref.html
|
||||
== huge-1.html?32768x100.jpg,100,100 huge-1.html?100x100.jpg,100,100
|
||||
== huge-1.html?32768x100.jpg,32768,100 huge-1.html?100x100.jpg,32768,100
|
||||
|
||||
# be careful changing fuzzy, the bug this test is testing is if the shade of orange is too dark
|
||||
fuzzy(0-1,0-144) == 1919368-1.html 1919368-1-ref.html
|
||||
|
||||
# Only need to run these with downscaling on
|
||||
!= 1421191-1.html about:blank
|
||||
== 1404366-1.html about:blank
|
||||
|
@ -911,7 +911,7 @@ def test_reftest_get_lineno2():
|
||||
lineno = sf.reftest_find_lineno(
|
||||
"image/test/reftest/downscaling/reftest.list", mods, allmods
|
||||
)
|
||||
assert lineno == 177
|
||||
assert lineno == 183
|
||||
|
||||
|
||||
def test_reftest_get_lineno3():
|
||||
|
Loading…
Reference in New Issue
Block a user