Bug 832446 - Don't use the high-quality downscaler on multipart images. r=jrmuizel a=akeybl
authorJoe Drew <joe@drew.ca>
Mon, 21 Jan 2013 11:37:54 -0500
changeset 123787 e5b4e20f90e61e27753841630491bb00cae213dc
parent 123786 bc8378e2544130a7bcd1d86b05092f95149c781b
child 123788 bd00c6ae955ec0a89b143919806bc69faba85634
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel, akeybl
bugs832446
milestone20.0a2
Bug 832446 - Don't use the high-quality downscaler on multipart images. r=jrmuizel a=akeybl
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2899,18 +2899,20 @@ IsDownscale(const gfxSize& scale)
 }
 
 bool
 RasterImage::CanScale(gfxPattern::GraphicsFilter aFilter,
                       gfxSize aScale)
 {
 // The high-quality scaler requires Skia.
 #ifdef MOZ_ENABLE_SKIA
+  // We don't use the scaler for animated or multipart images to avoid doing a
+  // bunch of work on an image that just gets thrown away.
   if (gHQDownscaling && aFilter == gfxPattern::FILTER_GOOD &&
-      !mAnim && mDecoded && IsDownscale(aScale)) {
+      !mAnim && mDecoded && !mMultipart && IsDownscale(aScale)) {
     gfxFloat factor = gHQDownscalingMinFactor / 1000.0;
     return (aScale.width < factor || aScale.height < factor);
   }
 #endif
 
   return false;
 }