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 "SkGeometry.h" | 8 #include "SkGeometry.h" |
9 #include "SkMatrix.h" | 9 #include "SkMatrix.h" |
10 #include "SkNx.h" | 10 #include "SkNx.h" |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 tValues[maxCount++] = t[i]; | 905 tValues[maxCount++] = t[i]; |
906 } | 906 } |
907 } | 907 } |
908 return maxCount; | 908 return maxCount; |
909 } | 909 } |
910 | 910 |
911 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], | 911 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], |
912 SkScalar tValues[3]) { | 912 SkScalar tValues[3]) { |
913 SkScalar t_storage[3]; | 913 SkScalar t_storage[3]; |
914 | 914 |
915 if (tValues == NULL) { | 915 if (tValues == nullptr) { |
916 tValues = t_storage; | 916 tValues = t_storage; |
917 } | 917 } |
918 | 918 |
919 int count = SkFindCubicMaxCurvature(src, tValues); | 919 int count = SkFindCubicMaxCurvature(src, tValues); |
920 | 920 |
921 if (dst) { | 921 if (dst) { |
922 if (count == 0) { | 922 if (count == 0) { |
923 memcpy(dst, src, 4 * sizeof(SkPoint)); | 923 memcpy(dst, src, 4 * sizeof(SkPoint)); |
924 } else { | 924 } else { |
925 SkChopCubicAt(src, dst, tValues, count); | 925 SkChopCubicAt(src, dst, tValues, count); |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 matrix.preScale(SK_Scalar1, -SK_Scalar1); | 1590 matrix.preScale(SK_Scalar1, -SK_Scalar1); |
1591 } | 1591 } |
1592 if (userMatrix) { | 1592 if (userMatrix) { |
1593 matrix.postConcat(*userMatrix); | 1593 matrix.postConcat(*userMatrix); |
1594 } | 1594 } |
1595 for (int i = 0; i < conicCount; ++i) { | 1595 for (int i = 0; i < conicCount; ++i) { |
1596 matrix.mapPoints(dst[i].fPts, 3); | 1596 matrix.mapPoints(dst[i].fPts, 3); |
1597 } | 1597 } |
1598 return conicCount; | 1598 return conicCount; |
1599 } | 1599 } |
OLD | NEW |