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 "GrPathUtils.h" | 8 #include "GrPathUtils.h" |
9 | 9 |
10 #include "GrTypes.h" | 10 #include "GrTypes.h" |
11 #include "SkGeometry.h" | 11 #include "SkGeometry.h" |
| 12 #include "SkMathPriv.h" |
12 | 13 |
13 SkScalar GrPathUtils::scaleToleranceToSrc(SkScalar devTol, | 14 SkScalar GrPathUtils::scaleToleranceToSrc(SkScalar devTol, |
14 const SkMatrix& viewM, | 15 const SkMatrix& viewM, |
15 const SkRect& pathBounds) { | 16 const SkRect& pathBounds) { |
16 // In order to tesselate the path we get a bound on how much the matrix can | 17 // In order to tesselate the path we get a bound on how much the matrix can |
17 // scale when mapping to screen coordinates. | 18 // scale when mapping to screen coordinates. |
18 SkScalar stretch = viewM.getMaxScale(); | 19 SkScalar stretch = viewM.getMaxScale(); |
19 SkScalar srcTol = devTol; | 20 SkScalar srcTol = devTol; |
20 | 21 |
21 if (stretch < 0) { | 22 if (stretch < 0) { |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 set_loop_klm(d, controlK, controlL, controlM); | 814 set_loop_klm(d, controlK, controlL, controlM); |
814 } else if (kCusp_SkCubicType == cType) { | 815 } else if (kCusp_SkCubicType == cType) { |
815 SkASSERT(0.f == d[0]); | 816 SkASSERT(0.f == d[0]); |
816 set_cusp_klm(d, controlK, controlL, controlM); | 817 set_cusp_klm(d, controlK, controlL, controlM); |
817 } else if (kQuadratic_SkCubicType == cType) { | 818 } else if (kQuadratic_SkCubicType == cType) { |
818 set_quadratic_klm(d, controlK, controlL, controlM); | 819 set_quadratic_klm(d, controlK, controlL, controlM); |
819 } | 820 } |
820 | 821 |
821 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]); | 822 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]); |
822 } | 823 } |
OLD | NEW |