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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // only return the public masks | 53 // only return the public masks |
54 return (TypeMask)(fTypeMask & 0xF); | 54 return (TypeMask)(fTypeMask & 0xF); |
55 } | 55 } |
56 | 56 |
57 /** Returns true if the matrix is identity. | 57 /** Returns true if the matrix is identity. |
58 */ | 58 */ |
59 bool isIdentity() const { | 59 bool isIdentity() const { |
60 return this->getType() == 0; | 60 return this->getType() == 0; |
61 } | 61 } |
62 | 62 |
| 63 bool isScaleTranslate() const { |
| 64 return !(this->getType() & ~(kScale_Mask | kTranslate_Mask)); |
| 65 } |
| 66 |
63 /** Returns true if will map a rectangle to another rectangle. This can be | 67 /** Returns true if will map a rectangle to another rectangle. This can be |
64 true if the matrix is identity, scale-only, or rotates a multiple of | 68 true if the matrix is identity, scale-only, or rotates a multiple of |
65 90 degrees. | 69 90 degrees. |
66 */ | 70 */ |
67 bool rectStaysRect() const { | 71 bool rectStaysRect() const { |
68 if (fTypeMask & kUnknown_Mask) { | 72 if (fTypeMask & kUnknown_Mask) { |
69 fTypeMask = this->computeTypeMask(); | 73 fTypeMask = this->computeTypeMask(); |
70 } | 74 } |
71 return (fTypeMask & kRectStaysRect_Mask) != 0; | 75 return (fTypeMask & kRectStaysRect_Mask) != 0; |
72 } | 76 } |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 738 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
735 int count); | 739 int count); |
736 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 740 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
737 | 741 |
738 static const MapPtsProc gMapPtsProcs[]; | 742 static const MapPtsProc gMapPtsProcs[]; |
739 | 743 |
740 friend class SkPerspIter; | 744 friend class SkPerspIter; |
741 }; | 745 }; |
742 | 746 |
743 #endif | 747 #endif |
OLD | NEW |