diff options
author | 2009-07-08 14:46:11 +0000 | |
---|---|---|
committer | 2009-07-08 14:46:11 +0000 | |
commit | 31745581ca72bd6d4898f1344d2cc6bc41710664 (patch) | |
tree | bf0774186da84967a62c54188174ac3c859dbdf0 /src | |
parent | 187d5595901d1120d9425851e5afdd773f574502 (diff) |
use scalarcomparetype in matrix tests, so we don't do anything tricky
(unnecessary) when floats are fast
git-svn-id: http://skia.googlecode.com/svn/trunk@259 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkMatrix.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 3d2712b073..6521962e91 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -18,6 +18,7 @@ #include "SkMatrix.h" #include "Sk64.h" #include "SkFloatBits.h" +#include "SkScalarCompare.h" #include "SkString.h" #ifdef SK_SCALAR_IS_FLOAT @@ -115,7 +116,7 @@ uint8_t SkMatrix::computeTypeMask() const { /////////////////////////////////////////////////////////////////////////////// void SkMatrix::setTranslate(SkScalar dx, SkScalar dy) { - if (SkScalarAs2sCompliment(dx) | SkScalarAs2sCompliment(dy)) { + if (SkScalarToCompareType(dx) || SkScalarToCompareType(dy)) { fMat[kMTransX] = dx; fMat[kMTransY] = dy; @@ -137,7 +138,7 @@ bool SkMatrix::preTranslate(SkScalar dx, SkScalar dy) { return this->preConcat(m); } - if (SkScalarAs2sCompliment(dx) | SkScalarAs2sCompliment(dy)) { + if (SkScalarToCompareType(dx) || SkScalarToCompareType(dy)) { fMat[kMTransX] += SkScalarMul(fMat[kMScaleX], dx) + SkScalarMul(fMat[kMSkewX], dy); fMat[kMTransY] += SkScalarMul(fMat[kMSkewY], dx) + @@ -155,7 +156,7 @@ bool SkMatrix::postTranslate(SkScalar dx, SkScalar dy) { return this->postConcat(m); } - if (SkScalarAs2sCompliment(dx) | SkScalarAs2sCompliment(dy)) { + if (SkScalarToCompareType(dx) || SkScalarToCompareType(dy)) { fMat[kMTransX] += dx; fMat[kMTransY] += dy; this->setTypeMask(kUnknown_Mask); |