diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index 37e6c591d9..1508b1a2ff 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -24,13 +24,12 @@ /** * Matrix calculations may be float or double. - * The default is double, as that is faster given our impl uses doubles - * for intermediate calculations. + * The default is float, as that's what Chromium's using. */ #if defined(SK_MSCALAR_IS_DOUBLE) && defined(SK_MSCALAR_IS_FLOAT) # error "cannot define both SK_MSCALAR_IS_DOUBLE and SK_MSCALAR_IS_FLOAT" #elif !defined(SK_MSCALAR_IS_DOUBLE) && !defined(SK_MSCALAR_IS_FLOAT) -# define SK_MSCALAR_IS_DOUBLE +# define SK_MSCALAR_IS_FLOAT #endif #if defined(SK_CPU_LENDIAN) && defined(SK_CPU_BENDIAN) diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp index 939675499c..cd11a7da2d 100644 --- a/tests/Matrix44Test.cpp +++ b/tests/Matrix44Test.cpp @@ -368,15 +368,15 @@ static void test_invert(skiatest::Reporter* reporter) { 0, 0, 0, 1); SkMatrix44 scaleTranslation(SkMatrix44::kUninitialized_Constructor); - scaleTranslation.setScale(10, 100, 1000); + scaleTranslation.setScale(32, 128, 1024); scaleTranslation.preTranslate(2, 3, 4); scaleTranslation.invert(&inverse); inverse.asRowMajord(inverseData); assert16(reporter, inverseData, - 0.1, 0, 0, -2, - 0, 0.01, 0, -3, - 0, 0, 0.001, -4, - 0, 0, 0, 1); + 0.03125, 0, 0, -2, + 0, 0.0078125, 0, -3, + 0, 0, 0.0009765625, -4, + 0, 0, 0, 1); SkMatrix44 rotation(SkMatrix44::kUninitialized_Constructor); rotation.setRotateDegreesAbout(0, 0, 1, 90); @@ -831,14 +831,14 @@ DEF_TEST(Matrix44, reporter) { // test mixed-valued matrix inverse mat.reset(); - mat.setScale(SkDoubleToMScalar(1.0e-10), + mat.setScale(SkDoubleToMScalar(1.0e-2), SkDoubleToMScalar(3.0), - SkDoubleToMScalar(1.0e+10)); + SkDoubleToMScalar(1.0e+2)); rot.setRotateDegreesAbout(0, 0, -1, 90); mat.postConcat(rot); - mat.postTranslate(SkDoubleToMScalar(1.0e+10), + mat.postTranslate(SkDoubleToMScalar(1.0e+2), SkDoubleToMScalar(3.0), - SkDoubleToMScalar(1.0e-10)); + SkDoubleToMScalar(1.0e-2)); REPORTER_ASSERT(reporter, mat.invert(NULL)); mat.invert(&inverse); iden1.setConcat(mat, inverse);