Bug 1070722 - Use the imagelib high quality downscaler on OSX instead of the quartz one. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 26 Sep 2014 15:05:14 -0400
changeset 232361 6fb508e952b15f736bd9ad7b0ad2805b83ca8f4a
parent 232360 a61ddc0c62fde82baa954ece3cf190e772e9f484
child 232362 a4ae53da4fe6c927420b459eb0e36e3973b10c57
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs1070722
milestone35.0a1
Bug 1070722 - Use the imagelib high quality downscaler on OSX instead of the quartz one. r=jrmuizel
content/html/document/reftests/reftests.list
gfx/2d/DrawTargetCG.cpp
image/test/reftest/downscaling/reftest.list
modules/libpref/init/all.js
--- a/content/html/document/reftests/reftests.list
+++ b/content/html/document/reftests/reftests.list
@@ -4,9 +4,9 @@
 == bug448564-4a.html          bug448564-4b.html
 == bug502168-1_malformed.html bug502168-1_well-formed.html
 
 # Test that image documents taken into account CSS properties like
 # image-orientation when determining the size of the image.
 # (Fuzzy necessary due to pixel-wise comparison of different JPEGs.
 # The vast majority of the fuzziness comes from Linux and WinXP.)
 fuzzy(1,149) == bug917595-iframe-1.html    bug917595-1-ref.html
-fuzzy(2,640) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg
+fuzzy(3,640) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -131,17 +131,17 @@ InterpolationQualityFromFilter(Filter aF
 {
   switch (aFilter) {
     default:
     case Filter::LINEAR:
       return kCGInterpolationLow;
     case Filter::POINT:
       return kCGInterpolationNone;
     case Filter::GOOD:
-      return kCGInterpolationDefault;
+      return kCGInterpolationLow;
   }
 }
 
 
 DrawTargetCG::DrawTargetCG()
   : mColorSpace(nullptr)
   , mCg(nullptr)
 {
--- a/image/test/reftest/downscaling/reftest.list
+++ b/image/test/reftest/downscaling/reftest.list
@@ -39,66 +39,58 @@ default-preferences pref(image.high_qual
 
 fuzzy-if(winWidget,16,20) fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html
 
 fuzzy(20,999) != downscale-2a.html?203,52,left about:blank
 fuzzy(20,999) != downscale-2b.html?203,52,left about:blank
 fuzzy(20,999) != downscale-2c.html?203,52,left about:blank
 fuzzy(20,999) != downscale-2d.html?203,52,left about:blank
 fuzzy(20,999) != downscale-2e.html?203,52,left about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?203,52,left about:blank
 
 fuzzy(20,999) != downscale-2a.html?205,53,left about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,left about:blank
 fuzzy(20,999) != downscale-2c.html?205,53,left about:blank
 fuzzy(20,999) != downscale-2d.html?205,53,left about:blank
 fuzzy(20,999) != downscale-2e.html?205,53,left about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?205,53,left about:blank
 
 fuzzy(20,999) != downscale-2a.html?203,52,right about:blank
 fuzzy(20,999) != downscale-2b.html?203,52,right about:blank
 fuzzy(20,999) != downscale-2c.html?203,52,right about:blank
 fuzzy(20,999) != downscale-2d.html?203,52,right about:blank
 fuzzy(20,999) != downscale-2e.html?203,52,right about:blank
-fuzzy(20,999) random-if(!cocoaWidget) != downscale-2f.html?203,52,right about:blank
 
 fuzzy(20,999) != downscale-2a.html?205,53,right about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,right about:blank
 fuzzy(20,999) != downscale-2c.html?205,53,right about:blank
 fuzzy(20,999) != downscale-2d.html?205,53,right about:blank
 fuzzy(20,999) != downscale-2e.html?205,53,right about:blank
-fuzzy(20,999) random-if(!cocoaWidget) != downscale-2f.html?205,53,right about:blank
 
 fuzzy(20,999) != downscale-2a.html?203,52,top about:blank
 fuzzy(20,999) != downscale-2b.html?203,52,top about:blank
 fuzzy(20,999) != downscale-2c.html?203,52,top about:blank
 fuzzy(20,999) != downscale-2d.html?203,52,top about:blank
 fuzzy(20,999) != downscale-2e.html?203,52,top about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?203,52,top about:blank
 
 fuzzy(20,999) != downscale-2a.html?205,53,top about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,top about:blank
 fuzzy(20,999) != downscale-2c.html?205,53,top about:blank
 fuzzy(20,999) != downscale-2d.html?205,53,top about:blank
 fuzzy(20,999) != downscale-2e.html?205,53,top about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?205,53,top about:blank
 
 fuzzy(20,999) != downscale-2a.html?203,52,bottom about:blank
 fuzzy(20,999) != downscale-2b.html?203,52,bottom about:blank
 fuzzy(20,999) != downscale-2c.html?203,52,bottom about:blank
 fuzzy(20,999) != downscale-2d.html?203,52,bottom about:blank
 fuzzy(20,999) != downscale-2e.html?203,52,bottom about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?203,52,bottom about:blank
 
 fuzzy(20,999) != downscale-2a.html?205,53,bottom about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,bottom about:blank
 fuzzy(20,999) != downscale-2c.html?205,53,bottom about:blank
 fuzzy(20,999) != downscale-2d.html?205,53,bottom about:blank
-fuzzy(20,999) != downscale-2e.html?205,53,bottom about:blank
-fuzzy(20,999) fails-if(!cocoaWidget) != downscale-2f.html?205,53,bottom about:blank
+fuzzy(20,999) fails-if(cocoaWidget) != downscale-2e.html?205,53,bottom about:blank
 
 # RUN TESTS WITH HIGH QUALITY DOWNSCALING ENABLED:
 # ================================================
 # High-quality downscaling enabled:
 default-preferences pref(image.high_quality_downscaling.enabled,true)
 
 fuzzy(31,127) fuzzy-if(d2d,31,147) == downscale-1.html downscale-1-ref.html # intermittently 147 pixels on win7 accelerated only (not win8)
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3667,23 +3667,17 @@ pref("browser.zoom.reflowZoom.reflowText
 pref("image.cache.size", 5242880);
 // A weight, from 0-1000, to place on time when comparing to size.
 // Size is given a weight of 1000 - timeweight.
 pref("image.cache.timeweight", 500);
 
 // The default Accept header sent for images loaded over HTTP(S)
 pref("image.http.accept", "image/png,image/*;q=0.8,*/*;q=0.5");
 
-// Whether we do high-quality image downscaling. OS X natively supports
-// high-quality image scaling.
-#ifdef XP_MACOSX
-pref("image.high_quality_downscaling.enabled", false);
-#else
 pref("image.high_quality_downscaling.enabled", true);
-#endif
 
 // The minimum percent downscaling we'll use high-quality downscaling on,
 // interpreted as a floating-point number / 1000.
 pref("image.high_quality_downscaling.min_factor", 1000);
 
 // The maximum memory size which we'll use high-quality uspcaling on,
 // interpreted as number of decoded bytes.
 pref("image.high_quality_upscaling.max_size", 20971520);