OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkMatrix_DEFINED | 10 #ifndef SkMatrix_DEFINED |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool hasPerspective() const { | 83 bool hasPerspective() const { |
84 return SkToBool(this->getPerspectiveTypeMaskOnly() & | 84 return SkToBool(this->getPerspectiveTypeMaskOnly() & |
85 kPerspective_Mask); | 85 kPerspective_Mask); |
86 } | 86 } |
87 | 87 |
88 /** Returns true if the matrix contains only translation, rotation or unifor
m scale | 88 /** Returns true if the matrix contains only translation, rotation or unifor
m scale |
89 Returns false if other transformation types are included or is degenerat
e | 89 Returns false if other transformation types are included or is degenerat
e |
90 */ | 90 */ |
91 bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const; | 91 bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const; |
92 | 92 |
| 93 /** Returns true if the matrix contains only translation, rotation or scale |
| 94 (non-uniform scale is allowed). |
| 95 Returns false if other transformation types are included or is degenerat
e |
| 96 */ |
| 97 bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const; |
| 98 |
93 enum { | 99 enum { |
94 kMScaleX, | 100 kMScaleX, |
95 kMSkewX, | 101 kMSkewX, |
96 kMTransX, | 102 kMTransX, |
97 kMSkewY, | 103 kMSkewY, |
98 kMScaleY, | 104 kMScaleY, |
99 kMTransY, | 105 kMTransY, |
100 kMPersp0, | 106 kMPersp0, |
101 kMPersp1, | 107 kMPersp1, |
102 kMPersp2 | 108 kMPersp2 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 665 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
660 int count); | 666 int count); |
661 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 667 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
662 | 668 |
663 static const MapPtsProc gMapPtsProcs[]; | 669 static const MapPtsProc gMapPtsProcs[]; |
664 | 670 |
665 friend class SkPerspIter; | 671 friend class SkPerspIter; |
666 }; | 672 }; |
667 | 673 |
668 #endif | 674 #endif |
OLD | NEW |