Use float epsilon instead of double to determine axis alignment

Previous to this CL, double epsilon was used as the zero threshold for
blink::TransformationMatrix::Preserves2dAxisAlignment(), while the
gfx::Transform::Preserves2dAxisAlignment() function used float epsilon
for this purpose. This brings the definitions back together, which
should hopefully fix crbug.com/938007

Bug: 938007
Change-Id: I2d9596c2c58e6a2c86fd1c0bbfee3ec87388bc0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1512154
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639213}
diff --git a/third_party/blink/renderer/platform/transforms/transformation_matrix.cc b/third_party/blink/renderer/platform/transforms/transformation_matrix.cc
index 2ec1aa32..e325303 100644
--- a/third_party/blink/renderer/platform/transforms/transformation_matrix.cc
+++ b/third_party/blink/renderer/platform/transforms/transformation_matrix.cc
@@ -2030,7 +2030,9 @@
   if (has_x_or_y_perspective)
     return false;
 
-  constexpr double kEpsilon = std::numeric_limits<double>::epsilon();
+  // Use float epsilon here, not double, to round very small rotations back
+  // to zero.
+  constexpr double kEpsilon = std::numeric_limits<float>::epsilon();
 
   int num_non_zero_in_row_1 = 0;
   int num_non_zero_in_row_2 = 0;