Temporarily adjust Matrix.isSimilarity test tolerance on 64-bit ARM devices
BUG=skia:2405
R=halcanary@google.com, jvanverth@google.com, reed@google.com
Author: djsollen@google.com
Review URL: https://codereview.chromium.org/494113002
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 4a67ff6..4fd9bf8 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -26,11 +26,6 @@
}],
],
}],
- [ 'skia_arch_type == "arm64"', {
- 'cflags': [
- '-ffp-contract=off',
- ],
- }],
# As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac).
[ 'skia_arch_type == "x86"', {
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 9c7a520..cbec021 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -320,7 +320,13 @@
for (int angle = 0; angle < 360; ++angle) {
mat.reset();
mat.setRotate(SkIntToScalar(angle));
+#ifndef SK_CPU_ARM64
REPORTER_ASSERT(reporter, mat.isSimilarity());
+#else
+ // 64-bit ARM devices built with -O2 and -ffp-contract=fast have a loss
+ // of precision and require that we have a higher tolerance
+ REPORTER_ASSERT(reporter, mat.isSimilarity(SK_ScalarNearlyZero + 0.00010113f));
+#endif
}
// see if there are any accumulated precision issues