Index: src/core/SkMatrix.cpp |
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp |
index 7ae4ed21eb4cbd78dcbafaed0694816782f4173b..f60ce85a6cacaa5d9c095d249e0485d515e2531a 100644 |
--- a/src/core/SkMatrix.cpp |
+++ b/src/core/SkMatrix.cpp |
@@ -1150,30 +1150,19 @@ const SkMatrix::MapXYProc SkMatrix::gMapXYProcs[] = { |
// if its nearly zero (just made up 26, perhaps it should be bigger or smaller) |
#define PerspNearlyZero(x) SkScalarNearlyZero(x, (1.0f / (1 << 26))) |
-bool SkMatrix::fixedStepInX(SkScalar y, SkFixed* stepX, SkFixed* stepY) const { |
- if (PerspNearlyZero(fMat[kMPersp0])) { |
- if (stepX || stepY) { |
- if (PerspNearlyZero(fMat[kMPersp1]) && |
- PerspNearlyZero(fMat[kMPersp2] - 1)) { |
- if (stepX) { |
- *stepX = SkScalarToFixed(fMat[kMScaleX]); |
- } |
- if (stepY) { |
- *stepY = SkScalarToFixed(fMat[kMSkewY]); |
- } |
- } else { |
- SkScalar z = y * fMat[kMPersp1] + fMat[kMPersp2]; |
- if (stepX) { |
- *stepX = SkScalarToFixed(fMat[kMScaleX] / z); |
- } |
- if (stepY) { |
- *stepY = SkScalarToFixed(fMat[kMSkewY] / z); |
- } |
- } |
- } |
- return true; |
+bool SkMatrix::isFixedStepInX() const { |
+ return PerspNearlyZero(fMat[kMPersp0]); |
+} |
+ |
+SkVector SkMatrix::fixedStepInX(SkScalar y) const { |
+ SkASSERT(PerspNearlyZero(fMat[kMPersp0])); |
+ if (PerspNearlyZero(fMat[kMPersp1]) && |
+ PerspNearlyZero(fMat[kMPersp2] - 1)) { |
+ return SkVector::Make(fMat[kMScaleX], fMat[kMSkewY]); |
+ } else { |
+ SkScalar z = y * fMat[kMPersp1] + fMat[kMPersp2]; |
+ return SkVector::Make(fMat[kMScaleX] / z, fMat[kMSkewY] / z); |
} |
- return false; |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -1800,4 +1789,3 @@ void SkRSXform::toQuad(SkScalar width, SkScalar height, SkPoint quad[4]) const { |
quad[3].set(m01 * height + m02, m11 * height + m12); |
#endif |
} |
- |