Bug 1020556 - Increase tolerance for scale snapping so that we don't end up with an unnecessary scale factor for pure rotation transforms due to floating point inaccuracies. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Tue, 08 Jul 2014 14:07:05 +0200
changeset 192842 2b0123d6e00a38918721f8269b32fdb4095c42f6
parent 192841 f9a0324345c70b882600cc033f6fbf0d7d462b30
child 192843 c6ca2340a718c9c9482e029180dc6c53ab197ca6
push id7663
push userkwierso@gmail.com
push dateWed, 09 Jul 2014 03:08:08 +0000
treeherderfx-team@48de6f4f82af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1020556
milestone33.0a1
Bug 1020556 - Increase tolerance for scale snapping so that we don't end up with an unnecessary scale factor for pure rotation transforms due to floating point inaccuracies. r=mattwoodrow
gfx/thebes/gfxUtils.cpp
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -768,20 +768,20 @@ gfxUtils::ClampToScaleFactor(gfxFloat aV
   bool inverse = false;
   if (aVal < 1.0) {
     inverse = true;
     aVal = 1 / aVal;
   }
 
   gfxFloat power = log(aVal)/log(kScaleResolution);
 
-  // If power is within 1e-6 of an integer, round to nearest to
+  // If power is within 1e-5 of an integer, round to nearest to
   // prevent floating point errors, otherwise round up to the
   // next integer value.
-  if (fabs(power - NS_round(power)) < 1e-6) {
+  if (fabs(power - NS_round(power)) < 1e-5) {
     power = NS_round(power);
   } else if (inverse) {
     power = floor(power);
   } else {
     power = ceil(power);
   }
 
   gfxFloat scale = pow(kScaleResolution, power);