Index: include/core/SkMatrix.h |
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h |
index da7838b78195c6a7d101a29399a49406270714e2..a272051067e7dabb511ac38d9ad01f07c206fd55 100644 |
--- a/include/core/SkMatrix.h |
+++ b/include/core/SkMatrix.h |
@@ -457,6 +457,12 @@ public: |
this->getMapXYProc()(*this, x, y, result); |
} |
+ SkPoint mapXY(SkScalar x, SkScalar y) const { |
+ SkPoint result; |
+ this->getMapXYProc()(*this, x, y, &result); |
+ return result; |
+ } |
+ |
/** Apply this matrix to the array of vectors specified by src, and write |
the transformed vectors into the array of vectors specified by dst. |
This is similar to mapPoints, but ignores any translation in the matrix. |
@@ -480,6 +486,17 @@ public: |
this->mapVectors(vecs, vecs, count); |
} |
+ void mapVector(SkScalar dx, SkScalar dy, SkVector* result) const { |
+ SkVector vec = { dx, dy }; |
+ this->mapVectors(result, &vec, 1); |
+ } |
+ |
+ SkVector mapVector(SkScalar dx, SkScalar dy) const { |
+ SkVector vec = { dx, dy }; |
+ this->mapVectors(&vec, &vec, 1); |
+ return vec; |
+ } |
+ |
/** Apply this matrix to the src rectangle, and write the transformed |
rectangle into dst. This is accomplished by transforming the 4 corners |
of src, and then setting dst to the bounds of those points. |