From 4296ce21ad7e967a95491a7568aa49d98292629e Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Thu, 22 May 2014 09:44:05 -0700 Subject: [PATCH] Bug 1006123, part 2: Add reftest for high-quality image downscaling. r=seth --- .../downscaling/downscale-1-bigimage.png | Bin 0 -> 195 bytes .../reftest/downscaling/downscale-1-ref.html | 8 +++++ .../downscaling/downscale-1-smallimage.png | Bin 0 -> 88 bytes .../test/reftest/downscaling/downscale-1.html | 24 +++++++++++++++ image/test/reftest/downscaling/reftest.list | 28 ++++++++++++++++++ image/test/reftest/reftest.list | 3 ++ 6 files changed, 63 insertions(+) create mode 100644 image/test/reftest/downscaling/downscale-1-bigimage.png create mode 100644 image/test/reftest/downscaling/downscale-1-ref.html create mode 100644 image/test/reftest/downscaling/downscale-1-smallimage.png create mode 100644 image/test/reftest/downscaling/downscale-1.html create mode 100644 image/test/reftest/downscaling/reftest.list diff --git a/image/test/reftest/downscaling/downscale-1-bigimage.png b/image/test/reftest/downscaling/downscale-1-bigimage.png new file mode 100644 index 0000000000000000000000000000000000000000..5e018590c3757d591f799b0987f523dd5ee27f2a GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^-XP4u0wgE7Z%PDGOiAAEE)4(M`_JqL@;D1TB8wRq zxP?KOkzv*x37{Z*iKnkC`#n|;VJ0byhHo2zLLr_mjv*QM-rm~C%V5C4Z1CX!{M-By z3s-GU+i0YothHQQJB*E+0C?>l_AOpKI}rl*9^Tbd!8F;Wpy4dgd + + + + + + diff --git a/image/test/reftest/downscaling/downscale-1-smallimage.png b/image/test/reftest/downscaling/downscale-1-smallimage.png new file mode 100644 index 0000000000000000000000000000000000000000..588e6b78df68b1552716823473bbfec2f1cb562c GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc0wmQNuC@Uwc~2L|5RLQ6DGDtAoHf+gln$;q l6xjMiJEdjmcE>kv44);LRK-?>7Xg(rc)I$ztaD0e0svbx7h?bb literal 0 HcmV?d00001 diff --git a/image/test/reftest/downscaling/downscale-1.html b/image/test/reftest/downscaling/downscale-1.html new file mode 100644 index 000000000000..a9629ef85530 --- /dev/null +++ b/image/test/reftest/downscaling/downscale-1.html @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/image/test/reftest/downscaling/reftest.list b/image/test/reftest/downscaling/reftest.list new file mode 100644 index 000000000000..53f5988b0a21 --- /dev/null +++ b/image/test/reftest/downscaling/reftest.list @@ -0,0 +1,28 @@ +# Reftests for downscaling +# +# Downscaling can be a lossy process, so a bit of mismatch is acceptable here, +# as long as it's barely noticable visually. When necessary, this can be +# explicitly allowed via 'fuzzy'/'fuzzy-if' annotations. +# +# IMPORTANT: For robustness, each test should be listed *twice* in this +# manifest -- once with the high quality downscaling pref disabled, and once +# with this pref enabled. The pref is set via "default-preferences", so +# simply appending a new test to the lists below each of those lines should be +# sufficient. +# +# Also note that Mac OS X has its own system-level downscaling algorithm, so +# tests here may need Mac-specific "fuzzy-if(cocoaWidget,...)" annotations. + +# RUN TESTS WITH HIGH QUALITY DOWNSCALING DISABLED: +# ================================================= +default-preferences pref(image.high_quality_downscaling.enabled,false) + +fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html + + +# RUN TESTS WITH HIGH QUALITY DOWNSCALING ENABLED: +# ================================================ +# High-quality downscaling enabled: +default-preferences pref(image.high_quality_downscaling.enabled,true) + +fuzzy(31,127) == downscale-1.html downscale-1-ref.html diff --git a/image/test/reftest/reftest.list b/image/test/reftest/reftest.list index c5616cc40c3c..4eb2fc34ef6f 100644 --- a/image/test/reftest/reftest.list +++ b/image/test/reftest/reftest.list @@ -43,5 +43,8 @@ include generic/reftest.list # Color management test include color-management/reftest.list +# Downscaling tests +include downscaling/reftest.list + # Lossless encoders skip-if(Android||B2G) include encoders-lossless/reftest.list # bug 783621