| 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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 715 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
| 712 int count); | 716 int count); |
| 713 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 717 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 714 | 718 |
| 715 static const MapPtsProc gMapPtsProcs[]; | 719 static const MapPtsProc gMapPtsProcs[]; |
| 716 | 720 |
| 717 friend class SkPerspIter; | 721 friend class SkPerspIter; |
| 718 }; | 722 }; |
| 719 | 723 |
| 720 #endif | 724 #endif |
| OLD | NEW |