Bug 1315854 - Account for rounding error when checking if certain transforms are the identity in AsyncCompositionManager::AlignFixedAndStickyLayers(). r=mstange draft
authorBotond Ballo <botond@mozilla.com>
Wed, 16 Nov 2016 15:59:24 -0500
changeset 439933 ee81a68b7e084896333cb0a9ac97a83e3c0f0388
parent 438550 71fd23fa0803a548b6e571aa25d0533a06cd0421
child 537288 7bbd8fa7cbc6ada70bfebb80bcc93c92619b069d
push id36133
push userbballo@mozilla.com
push dateWed, 16 Nov 2016 20:59:51 +0000
reviewersmstange
bugs1315854
milestone53.0a1
Bug 1315854 - Account for rounding error when checking if certain transforms are the identity in AsyncCompositionManager::AlignFixedAndStickyLayers(). r=mstange MozReview-Commit-ID: 4xxuqWHedeS
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -473,26 +473,28 @@ AsyncCompositionManager::AlignFixedAndSt
   // so there shouldn't be a transform in between the fixed layer and
   // the subtree root layer.
 #ifdef DEBUG
   Matrix4x4 ancestorTransform;
   if (layer != aTransformedSubtreeRoot) {
     AccumulateLayerTransforms(layer->GetParent(), aTransformedSubtreeRoot,
                               ancestorTransform);
   }
+  ancestorTransform.NudgeToIntegersFixedEpsilon();
   MOZ_ASSERT(ancestorTransform.IsIdentity());
 #endif
 
   // Since we create container layers for fixed layers, there shouldn't
   // a local CSS or OMTA transform on the fixed layer, either (any local
   // transform would go onto a descendant layer inside the container
   // layer).
 #ifdef DEBUG
   Matrix4x4 localTransform;
   GetBaseTransform(layer, &localTransform);
+  localTransform.NudgeToIntegersFixedEpsilon();
   MOZ_ASSERT(localTransform.IsIdentity());
 #endif
 
   // Now work out the translation necessary to make sure the layer doesn't
   // move given the new sub-tree root transform.
 
   // Get the layer's fixed anchor point, in the layer's local coordinate space
   // (before any transform is applied).