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 #ifndef GrPathUtils_DEFINED | 8 #ifndef GrPathUtils_DEFINED |
9 #define GrPathUtils_DEFINED | 9 #define GrPathUtils_DEFINED |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // represent the implicit form of the cubic as f(x,y,w) = K^3 - LM. The w te
rm | 161 // represent the implicit form of the cubic as f(x,y,w) = K^3 - LM. The w te
rm |
162 // will always be 1. The output is stored in the array klm, where the values
are: | 162 // will always be 1. The output is stored in the array klm, where the values
are: |
163 // K = (klm[0], klm[1], klm[2]) | 163 // K = (klm[0], klm[1], klm[2]) |
164 // L = (klm[3], klm[4], klm[5]) | 164 // L = (klm[3], klm[4], klm[5]) |
165 // M = (klm[6], klm[7], klm[8]) | 165 // M = (klm[6], klm[7], klm[8]) |
166 // | 166 // |
167 // Notice that the klm lines are calculated in the same space as the input c
ontrol points. | 167 // Notice that the klm lines are calculated in the same space as the input c
ontrol points. |
168 // If you transform the points the lines will also need to be transformed. T
his can be done | 168 // If you transform the points the lines will also need to be transformed. T
his can be done |
169 // by mapping the lines with the inverse-transpose of the matrix used to map
the points. | 169 // by mapping the lines with the inverse-transpose of the matrix used to map
the points. |
170 void getCubicKLM(const SkPoint p[4], SkScalar klm[9]); | 170 void getCubicKLM(const SkPoint p[4], SkScalar klm[9]); |
| 171 |
| 172 // When tessellating curved paths into linear segments, this defines the max
imum distance |
| 173 // in screen space which a segment may deviate from the mathmatically correc
t value. |
| 174 // Above this value, the segment will be subdivided. |
| 175 // This value was chosen to approximate the supersampling accuracy of the ra
ster path (16 |
| 176 // samples, or one quarter pixel). |
| 177 static const SkScalar kDefaultTolerance = SkDoubleToScalar(0.25); |
171 }; | 178 }; |
172 #endif | 179 #endif |
OLD | NEW |