diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-13 19:41:55 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-13 19:41:55 +0000 |
commit | 1ddd7c39289b7dd18537fdac4b630e378cd78842 (patch) | |
tree | e802895939318a2dc2d09a4322833074d58d6dcb /include | |
parent | da44067ec97fddd3bab52da34e2fc5ddc5241c34 (diff) |
Change pdfTransform to asAffine.
http://codereview.appspot.com/4704044/
git-svn-id: http://skia.googlecode.com/svn/trunk@1851 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMatrix.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 533e5345ad..a8c50fc4d5 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -92,6 +92,18 @@ public: kMPersp2 }; + /** Affine arrays are in column major order + because that's how PDF and XPS like it. + */ + enum { + kAScaleX, + kASkewY, + kASkewX, + kAScaleY, + kATransX, + kATransY + }; + SkScalar operator[](int index) const { SkASSERT((unsigned)index < 9); return fMat[index]; @@ -318,12 +330,19 @@ public: */ bool invert(SkMatrix* inverse) const; - /** Fills the passed array with the tranform values in the right order - for PDFs. If the matrix is a perspective transform, returns false - and fills the array with an identity transform. - @param transform The array to fill in. + /** Fills the passed array with affine identity values + in column major order. + @param affine The array to fill with affine identity values. + Must not be NULL. + */ + static void SetAffineIdentity(SkScalar affine[6]); + + /** Fills the passed array with the affine values in column major order. + If the matrix is a perspective transform, returns false + and does not change the passed array. + @param affine The array to fill with affine values. Ignored if NULL. */ - bool pdfTransform(SkScalar transform[6]) const; + bool asAffine(SkScalar affine[6]) const; /** Apply this matrix to the array of points specified by src, and write the transformed points into the array of points specified by dst. |