Bug 734288: Use double math instead of float math for computing surface sizes in nsSVGFE::SetupScalingFilter. r=longsonr a=lsblakk
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 09 Mar 2012 14:32:11 -0800
changeset 81734 61db5cadd6e63d0b72aef470ad9fd04f796c7b6c
parent 81733 b70216a1859d097dc00a7d4f601a953d7746aa08
child 81735 27b1269dac4dda632e35d7537953bf5970e2926e
push id67
push userdholbert@mozilla.com
push dateTue, 20 Mar 2012 19:24:29 +0000
reviewerslongsonr, lsblakk
bugs734288
milestone10.0.4esrpre
Bug 734288: Use double math instead of float math for computing surface sizes in nsSVGFE::SetupScalingFilter. r=longsonr a=lsblakk
content/svg/content/src/nsSVGFilters.cpp
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -142,22 +142,22 @@ nsSVGFE::SetupScalingFilter(nsSVGFilterI
   result.mRescaling = aKernelUnitLength->IsExplicitlySet();
   if (!result.mRescaling) {
     result.mSource = aSource->mImage;
     result.mTarget = aTarget->mImage;
     result.mDataRect = aDataRect;
     return result;
   }
 
-  float kernelX = aInstance->GetPrimitiveNumber(nsSVGUtils::X,
-                                                aKernelUnitLength,
-                                                nsSVGNumberPair::eFirst);
-  float kernelY = aInstance->GetPrimitiveNumber(nsSVGUtils::Y,
-                                                aKernelUnitLength,
-                                                nsSVGNumberPair::eSecond);
+  gfxFloat kernelX = aInstance->GetPrimitiveNumber(nsSVGUtils::X,
+                                                   aKernelUnitLength,
+                                                   nsSVGNumberPair::eFirst);
+  gfxFloat kernelY = aInstance->GetPrimitiveNumber(nsSVGUtils::Y,
+                                                   aKernelUnitLength,
+                                                   nsSVGNumberPair::eSecond);
   if (kernelX <= 0 || kernelY <= 0)
     return result;
 
   bool overflow = false;
   gfxIntSize scaledSize =
     nsSVGUtils::ConvertToSurfaceSize(gfxSize(aTarget->mImage->Width() / kernelX,
                                              aTarget->mImage->Height() / kernelY),
                                      &overflow);