diff options
author | 2013-09-04 07:01:39 +0000 | |
---|---|---|
committer | 2013-09-04 07:01:39 +0000 | |
commit | 85092f05c406ed5a0c65ff576816924c1a6b903b (patch) | |
tree | fdd05be111e530208ad7f3e6dbf43bdc189f8303 | |
parent | 5651512aa31422bdf234efc8341a9673592b18d3 (diff) |
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@11071 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkMatrix.cpp | 8 | ||||
-rw-r--r-- | src/core/SkMatrixUtils.h | 2 | ||||
-rw-r--r-- | tests/MatrixTest.cpp | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 263b2efe36..ff24ecfb03 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -2068,7 +2068,7 @@ bool SkDecomposeUpper2x2(const SkMatrix& matrix, w2 = Sd; cos2 = cosQ; sin2 = sinQ; - } else { + } else { double diff = Sa - Sd; double discriminant = sqrt(diff*diff + 4.0*Sb*Sb); double trace = Sa + Sd; @@ -2079,16 +2079,16 @@ bool SkDecomposeUpper2x2(const SkMatrix& matrix, w1 = 0.5*(trace - discriminant); w2 = 0.5*(trace + discriminant); } - + cos1 = SkDoubleToScalar(Sb); sin1 = SkDoubleToScalar(w1 - Sa); SkScalar reciplen = SK_Scalar1/SkScalarSqrt(cos1*cos1 + sin1*sin1); cos1 *= reciplen; sin1 *= reciplen; - + // rotation 2 is composition of Q and U cos2 = cos1*cosQ - sin1*sinQ; sin2 = sin1*cosQ + cos1*sinQ; - + // rotation 1 is U^T sin1 = -sin1; } diff --git a/src/core/SkMatrixUtils.h b/src/core/SkMatrixUtils.h index 3fc1440e15..d1b6658d07 100644 --- a/src/core/SkMatrixUtils.h +++ b/src/core/SkMatrixUtils.h @@ -42,7 +42,7 @@ static inline bool SkTreatAsSpriteFilter(const SkMatrix& matrix, /** Decomposes the upper-left 2x2 of the matrix into a rotation (represented by the cosine and sine of the rotation angle), followed by a non-uniform scale, - followed by another rotation. If there is a reflection, one of the scale + followed by another rotation. If there is a reflection, one of the scale factors will be negative. Returns true if successful. Returns false if the matrix is degenerate. */ diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index c225565cc4..70d2c1d2c1 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -378,7 +378,7 @@ static bool check_matrix_recomposition(const SkMatrix& mat, SkScalar scaleY = scale.fY; SkScalar c2 = rotation2.fX; SkScalar s2 = rotation2.fY; - + // We do a relative check here because large scale factors cause problems with an absolute check bool result = scalar_nearly_equal_relative(mat[SkMatrix::kMScaleX], scaleX*c1*c2 - scaleY*s1*s2) && @@ -457,13 +457,13 @@ static void test_matrix_decomposition(skiatest::Reporter* reporter) { mat.postScale(kScale1, kScale0); REPORTER_ASSERT(reporter, SkDecomposeUpper2x2(mat, &rotation1, &scale, &rotation2)); REPORTER_ASSERT(reporter, check_matrix_recomposition(mat, rotation1, scale, rotation2)); - + // anisotropic scale then rotation mat.setScale(kScale1, kScale0); mat.postRotate(kRotation0); REPORTER_ASSERT(reporter, SkDecomposeUpper2x2(mat, &rotation1, &scale, &rotation2)); REPORTER_ASSERT(reporter, check_matrix_recomposition(mat, rotation1, scale, rotation2)); - + // anisotropic scale then rotation mat.setScale(kScale1, kScale0); mat.postRotate(90); @@ -483,7 +483,7 @@ static void test_matrix_decomposition(skiatest::Reporter* reporter) { mat.postRotate(kRotation1); REPORTER_ASSERT(reporter, SkDecomposeUpper2x2(mat, &rotation1, &scale, &rotation2)); REPORTER_ASSERT(reporter, check_matrix_recomposition(mat, rotation1, scale, rotation2)); - + // rotation, anisotropic scale + reflection, then different rotation mat.setRotate(kRotation0); mat.postScale(-kScale1, kScale0); |