| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #include "SkMatrix.h" | 8 #include "SkMatrix.h" |
| 9 #include "Sk64.h" | 9 #include "Sk64.h" |
| 10 #include "SkFloatBits.h" | 10 #include "SkFloatBits.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 enum { | 40 enum { |
| 41 kTranslate_Shift, | 41 kTranslate_Shift, |
| 42 kScale_Shift, | 42 kScale_Shift, |
| 43 kAffine_Shift, | 43 kAffine_Shift, |
| 44 kPerspective_Shift, | 44 kPerspective_Shift, |
| 45 kRectStaysRect_Shift | 45 kRectStaysRect_Shift |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #ifdef SK_SCALAR_IS_FLOAT | 48 #ifdef SK_SCALAR_IS_FLOAT |
| 49 static const int32_t kScalar1Int = 0x3f800000; | 49 static const int32_t kScalar1Int = 0x3f800000; |
| 50 static const int32_t kPersp1Int = 0x3f800000; | |
| 51 #else | 50 #else |
| 52 #define scalarAsInt(x) (x) | 51 #define scalarAsInt(x) (x) |
| 53 static const int32_t kScalar1Int = (1 << 16); | 52 static const int32_t kScalar1Int = (1 << 16); |
| 54 static const int32_t kPersp1Int = (1 << 30); | 53 static const int32_t kPersp1Int = (1 << 30); |
| 55 #endif | 54 #endif |
| 56 | 55 |
| 57 uint8_t SkMatrix::computePerspectiveTypeMask() const { | 56 uint8_t SkMatrix::computePerspectiveTypeMask() const { |
| 58 #ifdef SK_SCALAR_SLOW_COMPARES | 57 #ifdef SK_SCALAR_SLOW_COMPARES |
| 59 if (SkScalarAs2sCompliment(fMat[kMPersp0]) | | 58 if (SkScalarAs2sCompliment(fMat[kMPersp0]) | |
| 60 SkScalarAs2sCompliment(fMat[kMPersp1]) | | 59 SkScalarAs2sCompliment(fMat[kMPersp1]) | |
| (...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2101 rotation1->fX = cos1; | 2100 rotation1->fX = cos1; |
| 2102 rotation1->fY = sin1; | 2101 rotation1->fY = sin1; |
| 2103 } | 2102 } |
| 2104 if (NULL != rotation2) { | 2103 if (NULL != rotation2) { |
| 2105 rotation2->fX = cos2; | 2104 rotation2->fX = cos2; |
| 2106 rotation2->fY = sin2; | 2105 rotation2->fY = sin2; |
| 2107 } | 2106 } |
| 2108 | 2107 |
| 2109 return true; | 2108 return true; |
| 2110 } | 2109 } |
| OLD | NEW |