aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkMatrix.cpp8
-rw-r--r--tests/Matrix44Test.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index e3e43ca690..263b2efe36 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -2060,7 +2060,7 @@ bool SkDecomposeUpper2x2(const SkMatrix& matrix,
// Now we need to compute eigenvalues of S (our scale factors)
// and eigenvectors (bases for our rotation)
// From this, should be able to reconstruct S as U*W*U^T
- if (SkScalarNearlyZero(Sb)) {
+ if (SkScalarNearlyZero(SkDoubleToScalar(Sb))) {
// already diagonalized
cos1 = SK_Scalar1;
sin1 = 0;
@@ -2080,7 +2080,7 @@ bool SkDecomposeUpper2x2(const SkMatrix& matrix,
w2 = 0.5*(trace + discriminant);
}
- cos1 = Sb; sin1 = w1 - Sa;
+ cos1 = SkDoubleToScalar(Sb); sin1 = SkDoubleToScalar(w1 - Sa);
SkScalar reciplen = SK_Scalar1/SkScalarSqrt(cos1*cos1 + sin1*sin1);
cos1 *= reciplen;
sin1 *= reciplen;
@@ -2094,8 +2094,8 @@ bool SkDecomposeUpper2x2(const SkMatrix& matrix,
}
if (NULL != scale) {
- scale->fX = w1;
- scale->fY = w2;
+ scale->fX = SkDoubleToScalar(w1);
+ scale->fY = SkDoubleToScalar(w2);
}
if (NULL != rotation1) {
rotation1->fX = cos1;
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index 6c29a55966..67af60df90 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -513,10 +513,10 @@ static void TestMatrix44(skiatest::Reporter* reporter) {
// test mixed-valued matrix inverse
mat.reset();
- mat.setScale(1.0e-11, 3.0, 1.0e+11);
+ mat.setScale(1.0e-10, 3.0, 1.0e+10);
rot.setRotateDegreesAbout(0, 0, -1, 90);
mat.postConcat(rot);
- mat.postTranslate(1.0e+11, 3.0, 1.0e-11);
+ mat.postTranslate(1.0e+10, 3.0, 1.0e-10);
REPORTER_ASSERT(reporter, mat.invert(NULL));
mat.invert(&inverse);
iden1.setConcat(mat, inverse);