diff options
author | Derek Sollenberger <djsollen@google.com> | 2014-08-21 20:13:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-21 20:13:28 +0000 |
commit | 5f21f4357bb6b6f3daaab6b69c1862621aef136f (patch) | |
tree | 2bdc3830267e4aa6ee1b4ad789728e4ed18463ea | |
parent | 4b24578b898343dddb51a565d7b919d64e2dc2db (diff) | |
parent | 258aaff33bbf402bd48f57f6e4b163a6afaa2371 (diff) | |
download | skia-5f21f4357bb6b6f3daaab6b69c1862621aef136f.tar.gz |
Merge "enable ffp-contract on arm64 builds" into lmp-dev
-rw-r--r-- | Android.mk | 3 | ||||
-rw-r--r-- | gyp/common_conditions.gypi | 5 | ||||
-rw-r--r-- | tests/MatrixTest.cpp | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk index 9fa17b6d80..0e62f9e593 100644 --- a/Android.mk +++ b/Android.mk @@ -665,9 +665,6 @@ LOCAL_SRC_FILES_mips64 += \ src/opts/SkUtils_opts_none.cpp \ src/opts/SkXfermode_opts_none.cpp -LOCAL_CFLAGS_arm64 += \ - -ffp-contract=off - LOCAL_SRC_FILES_arm64 += \ src/opts/SkBitmapProcState_arm_neon.cpp \ src/opts/SkBitmapProcState_matrixProcs_neon.cpp \ diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index ed54a58feb..a0a744582a 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -21,6 +21,11 @@ '-mfpmath=sse', ], }], + [ 'skia_arch_type == "arm64"', { + 'cflags': [ + '-ffp-contract=off', + ], + }], [ 'skia_os == "win"', { diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index 9c7a520369..cbec021b40 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -320,7 +320,13 @@ static void test_matrix_is_similarity(skiatest::Reporter* reporter) { 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 |