Bug 1258313 - Allow snapping of 'pseudo' 3d transforms. r=jrmuizel, a=ritu
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 06 Apr 2016 15:29:32 +1200
changeset 323975 ae136454b6b76b79a5bf9498fe262c75bd03c763
parent 323974 c0d6effecccbae1a3105e231428947d5c0d23ded
child 323976 72bdf0a085a53a9ff83511bee4dcc353731866a7
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, ritu
bugs1258313
milestone47.0a2
Bug 1258313 - Allow snapping of 'pseudo' 3d transforms. r=jrmuizel, a=ritu
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -619,17 +619,17 @@ Layer::SnapTransformTranslation(const Ma
   }
 
   if (!mManager->IsSnappingEffectiveTransforms()) {
     return aTransform;
   }
 
   Matrix matrix2D;
   Matrix4x4 result;
-  if (aTransform.Is2D(&matrix2D) &&
+  if (aTransform.CanDraw2D(&matrix2D) &&
       !matrix2D.HasNonTranslation() &&
       matrix2D.HasNonIntegerTranslation()) {
     IntPoint snappedTranslation = RoundedToInt(matrix2D.GetTranslation());
     Matrix snappedMatrix = Matrix::Translation(snappedTranslation.x,
                                                snappedTranslation.y);
     result = Matrix4x4::From2D(snappedMatrix);
     if (aResidualTransform) {
       // set aResidualTransform so that aResidual * snappedMatrix == matrix2D.