OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "SkIntersections.h" | 7 #include "SkIntersections.h" |
8 #include "SkLineParameters.h" | 8 #include "SkLineParameters.h" |
9 #include "SkPathOpsConic.h" | 9 #include "SkPathOpsConic.h" |
10 #include "SkPathOpsCubic.h" | 10 #include "SkPathOpsCubic.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 cy = conic_eval_numerator(&fPts[0].fY, fWeight, t2); | 149 cy = conic_eval_numerator(&fPts[0].fY, fWeight, t2); |
150 cz = conic_eval_denominator(fWeight, t2); | 150 cz = conic_eval_denominator(fWeight, t2); |
151 } else { | 151 } else { |
152 cx = fPts[0].fX; | 152 cx = fPts[0].fX; |
153 cy = fPts[0].fY; | 153 cy = fPts[0].fY; |
154 cz = 1; | 154 cz = 1; |
155 } | 155 } |
156 double bx = 2 * dx - (ax + cx) / 2; | 156 double bx = 2 * dx - (ax + cx) / 2; |
157 double by = 2 * dy - (ay + cy) / 2; | 157 double by = 2 * dy - (ay + cy) / 2; |
158 double bz = 2 * dz - (az + cz) / 2; | 158 double bz = 2 * dz - (az + cz) / 2; |
159 SkDConic dst = {{{{ax / az, ay / az}, {bx / bz, by / bz}, {cx / cz, cy / cz}
}}, | 159 SkDConic dst = {{{{ax / az, ay / az}, {bx / bz, by / bz}, {cx / cz, cy / cz}
} |
| 160 SkDEBUGPARAMS(fPts.fDebugGlobalState) }, |
160 SkDoubleToScalar(bz / sqrt(az * cz)) }; | 161 SkDoubleToScalar(bz / sqrt(az * cz)) }; |
161 return dst; | 162 return dst; |
162 } | 163 } |
163 | 164 |
164 SkDPoint SkDConic::subDivide(const SkDPoint& a, const SkDPoint& c, double t1, do
uble t2, | 165 SkDPoint SkDConic::subDivide(const SkDPoint& a, const SkDPoint& c, double t1, do
uble t2, |
165 SkScalar* weight) const { | 166 SkScalar* weight) const { |
166 SkDConic chopped = this->subDivide(t1, t2); | 167 SkDConic chopped = this->subDivide(t1, t2); |
167 *weight = chopped.fWeight; | 168 *weight = chopped.fWeight; |
168 return chopped[1]; | 169 return chopped[1]; |
169 } | 170 } |
OLD | NEW |