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 "SkFloatBits.h" | 9 #include "SkFloatBits.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 SkASSERT(src == dst || &dst[count] <= &src[0] || &src[count] <= &dst[0]); | 1018 SkASSERT(src == dst || &dst[count] <= &src[0] || &src[count] <= &dst[0]); |
1019 | 1019 |
1020 this->getMapPtsProc()(*this, dst, src, count); | 1020 this->getMapPtsProc()(*this, dst, src, count); |
1021 } | 1021 } |
1022 | 1022 |
1023 /////////////////////////////////////////////////////////////////////////////// | 1023 /////////////////////////////////////////////////////////////////////////////// |
1024 | 1024 |
1025 void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int co
unt) const { | 1025 void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int co
unt) const { |
1026 SkASSERT((dst && src && count > 0) || 0 == count); | 1026 SkASSERT((dst && src && count > 0) || 0 == count); |
1027 // no partial overlap | 1027 // no partial overlap |
1028 SkASSERT(src == dst || SkAbs32((int32_t)(src - dst)) >= 3*count); | 1028 SkASSERT(src == dst || &dst[3*count] <= &src[0] || &src[3*count] <= &dst[0])
; |
1029 | 1029 |
1030 if (count > 0) { | 1030 if (count > 0) { |
1031 if (this->isIdentity()) { | 1031 if (this->isIdentity()) { |
1032 memcpy(dst, src, 3*count*sizeof(SkScalar)); | 1032 memcpy(dst, src, 3*count*sizeof(SkScalar)); |
1033 return; | 1033 return; |
1034 } | 1034 } |
1035 do { | 1035 do { |
1036 SkScalar sx = src[0]; | 1036 SkScalar sx = src[0]; |
1037 SkScalar sy = src[1]; | 1037 SkScalar sy = src[1]; |
1038 SkScalar sw = src[2]; | 1038 SkScalar sw = src[2]; |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 rotation1->fX = cos1; | 1784 rotation1->fX = cos1; |
1785 rotation1->fY = sin1; | 1785 rotation1->fY = sin1; |
1786 } | 1786 } |
1787 if (rotation2) { | 1787 if (rotation2) { |
1788 rotation2->fX = cos2; | 1788 rotation2->fX = cos2; |
1789 rotation2->fY = sin2; | 1789 rotation2->fY = sin2; |
1790 } | 1790 } |
1791 | 1791 |
1792 return true; | 1792 return true; |
1793 } | 1793 } |
OLD | NEW |