Bug 777194. Part 1: Use an epsilon tolerance value when comparing residual translations. r=tnikkel
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 17 Aug 2012 11:38:59 +1200
changeset 107467 2365bb8a416a62ec1a362fe6b6cf16b595723907
parent 107466 1f8b8d69d23ac65e36f3bb5af07059f05096635e
child 107468 d756d091d9c800e1e0f07256dad9e216b634a1fd
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerstnikkel
bugs777194
milestone18.0a1
Bug 777194. Part 1: Use an epsilon tolerance value when comparing residual translations. r=tnikkel
gfx/layers/Layers.h
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1084,17 +1084,17 @@ public:
     gfxMatrix residual;
     mEffectiveTransform = SnapTransform(idealTransform, gfxRect(0, 0, 0, 0),
         mAllowResidualTranslation ? &residual : nullptr);
     // The residual can only be a translation because ThebesLayer snapping
     // only aligns a single point with the pixel grid; scale factors are always
     // preserved exactly
     NS_ASSERTION(!residual.HasNonTranslation(),
                  "Residual transform can only be a translation");
-    if (residual.GetTranslation() != mResidualTranslation) {
+    if (!residual.GetTranslation().WithinEpsilonOf(mResidualTranslation, 1e-3f)) {
       mResidualTranslation = residual.GetTranslation();
       NS_ASSERTION(-0.5 <= mResidualTranslation.x && mResidualTranslation.x < 0.5 &&
                    -0.5 <= mResidualTranslation.y && mResidualTranslation.y < 0.5,
                    "Residual translation out of range");
       mValidRegion.SetEmpty();
     }
     ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
   }