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 #include "SkMatrix44.h" | 8 #include "SkMatrix44.h" |
9 | 9 |
10 static inline bool eq4(const SkMScalar* SK_RESTRICT a, | 10 static inline bool eq4(const SkMScalar* SK_RESTRICT a, |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 dst4 += 4; | 812 dst4 += 4; |
813 } | 813 } |
814 } | 814 } |
815 | 815 |
816 static void map2_pf(const SkMScalar mat[][4], const float* SK_RESTRICT src2, | 816 static void map2_pf(const SkMScalar mat[][4], const float* SK_RESTRICT src2, |
817 int count, float* SK_RESTRICT dst4) { | 817 int count, float* SK_RESTRICT dst4) { |
818 for (int n = 0; n < count; ++n) { | 818 for (int n = 0; n < count; ++n) { |
819 float sx = src2[0]; | 819 float sx = src2[0]; |
820 float sy = src2[1]; | 820 float sy = src2[1]; |
821 for (int i = 0; i < 4; i++) { | 821 for (int i = 0; i < 4; i++) { |
822 dst4[i] = mat[0][i] * sx + mat[1][i] * sy + mat[3][i]; | 822 dst4[i] = SkMScalarToFloat(mat[0][i]) * sx + SkMScalarToFloat(mat[1] [i]) * sy + SkMScalarToFloat(mat[3][i]); |
epoger
2013/10/28 21:17:33
please wrap lines at 100 char
| |
823 } | 823 } |
824 src2 += 2; | 824 src2 += 2; |
825 dst4 += 4; | 825 dst4 += 4; |
826 } | 826 } |
827 } | 827 } |
828 | 828 |
829 static void map2_pd(const SkMScalar mat[][4], const double* SK_RESTRICT src2, | 829 static void map2_pd(const SkMScalar mat[][4], const double* SK_RESTRICT src2, |
830 int count, double* SK_RESTRICT dst4) { | 830 int count, double* SK_RESTRICT dst4) { |
831 for (int n = 0; n < count; ++n) { | 831 for (int n = 0; n < count; ++n) { |
832 double sx = src2[0]; | 832 double sx = src2[0]; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
925 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]); | 925 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]); |
926 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]); | 926 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]); |
927 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]); | 927 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]); |
928 | 928 |
929 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]); | 929 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]); |
930 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]); | 930 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]); |
931 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]); | 931 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]); |
932 | 932 |
933 return dst; | 933 return dst; |
934 } | 934 } |
OLD | NEW |