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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 } else { | 1054 } else { |
1055 SkMatrix tmp = *this; | 1055 SkMatrix tmp = *this; |
1056 | 1056 |
1057 tmp.fMat[kMTransX] = tmp.fMat[kMTransY] = 0; | 1057 tmp.fMat[kMTransX] = tmp.fMat[kMTransY] = 0; |
1058 tmp.clearTypeMask(kTranslate_Mask); | 1058 tmp.clearTypeMask(kTranslate_Mask); |
1059 tmp.mapPoints(dst, src, count); | 1059 tmp.mapPoints(dst, src, count); |
1060 } | 1060 } |
1061 } | 1061 } |
1062 | 1062 |
1063 bool SkMatrix::mapRect(SkRect* dst, const SkRect& src) const { | 1063 bool SkMatrix::mapRect(SkRect* dst, const SkRect& src) const { |
1064 SkASSERT(dst && &src); | 1064 SkASSERT(dst); |
1065 | 1065 |
1066 if (this->rectStaysRect()) { | 1066 if (this->rectStaysRect()) { |
1067 this->mapPoints((SkPoint*)dst, (const SkPoint*)&src, 2); | 1067 this->mapPoints((SkPoint*)dst, (const SkPoint*)&src, 2); |
1068 dst->sort(); | 1068 dst->sort(); |
1069 return true; | 1069 return true; |
1070 } else { | 1070 } else { |
1071 SkPoint quad[4]; | 1071 SkPoint quad[4]; |
1072 | 1072 |
1073 src.toQuad(quad); | 1073 src.toQuad(quad); |
1074 this->mapPoints(quad, quad, 4); | 1074 this->mapPoints(quad, quad, 4); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 rotation1->fX = cos1; | 1774 rotation1->fX = cos1; |
1775 rotation1->fY = sin1; | 1775 rotation1->fY = sin1; |
1776 } | 1776 } |
1777 if (rotation2) { | 1777 if (rotation2) { |
1778 rotation2->fX = cos2; | 1778 rotation2->fX = cos2; |
1779 rotation2->fY = sin2; | 1779 rotation2->fY = sin2; |
1780 } | 1780 } |
1781 | 1781 |
1782 return true; | 1782 return true; |
1783 } | 1783 } |
OLD | NEW |