Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: src/pathops/SkPathOpsConic.cpp

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pathops/SkPathOpsConic.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsConic.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698