| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkMatrix44_DEFINED | 8 #ifndef SkMatrix44_DEFINED |
| 9 #define SkMatrix44_DEFINED | 9 #define SkMatrix44_DEFINED |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 fData[1] = y; | 99 fData[1] = y; |
| 100 fData[2] = z; | 100 fData[2] = z; |
| 101 fData[3] = w; | 101 fData[3] = w; |
| 102 } | 102 } |
| 103 | 103 |
| 104 SkVector4& operator=(const SkVector4& src) { | 104 SkVector4& operator=(const SkVector4& src) { |
| 105 memcpy(fData, src.fData, sizeof(fData)); | 105 memcpy(fData, src.fData, sizeof(fData)); |
| 106 return *this; | 106 return *this; |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool operator==(const SkVector4& v) { | 109 bool operator==(const SkVector4& v) const { |
| 110 return fData[0] == v.fData[0] && fData[1] == v.fData[1] && | 110 return fData[0] == v.fData[0] && fData[1] == v.fData[1] && |
| 111 fData[2] == v.fData[2] && fData[3] == v.fData[3]; | 111 fData[2] == v.fData[2] && fData[3] == v.fData[3]; |
| 112 } | 112 } |
| 113 bool operator!=(const SkVector4& v) { | 113 bool operator!=(const SkVector4& v) const { |
| 114 return !(*this == v); | 114 return !(*this == v); |
| 115 } | 115 } |
| 116 bool equals(SkScalar x, SkScalar y, SkScalar z, SkScalar w = SK_Scalar1) { | 116 bool equals(SkScalar x, SkScalar y, SkScalar z, SkScalar w = SK_Scalar1) { |
| 117 return fData[0] == x && fData[1] == y && | 117 return fData[0] == x && fData[1] == y && |
| 118 fData[2] == z && fData[3] == w; | 118 fData[2] == z && fData[3] == w; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void set(SkScalar x, SkScalar y, SkScalar z, SkScalar w = SK_Scalar1) { | 121 void set(SkScalar x, SkScalar y, SkScalar z, SkScalar w = SK_Scalar1) { |
| 122 fData[0] = x; | 122 fData[0] = x; |
| 123 fData[1] = y; | 123 fData[1] = y; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 /** | 464 /** |
| 465 * Does not take the time to 'compute' the typemask. Only returns true if | 465 * Does not take the time to 'compute' the typemask. Only returns true if |
| 466 * we already know that this matrix is identity. | 466 * we already know that this matrix is identity. |
| 467 */ | 467 */ |
| 468 inline bool isTriviallyIdentity() const { | 468 inline bool isTriviallyIdentity() const { |
| 469 return 0 == fTypeMask; | 469 return 0 == fTypeMask; |
| 470 } | 470 } |
| 471 }; | 471 }; |
| 472 | 472 |
| 473 #endif | 473 #endif |
| OLD | NEW |