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 107358 2365bb8a416a62ec1a362fe6b6cf16b595723907
parent 107357 1f8b8d69d23ac65e36f3bb5af07059f05096635e
child 107359 d756d091d9c800e1e0f07256dad9e216b634a1fd
push id23486
push usergraememcc_firefox@graeme-online.co.uk
push dateWed, 19 Sep 2012 14:18:40 +0000
treeherdermozilla-central@0c8ac138706e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs777194
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);
   }