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

Unified Diff: src/pathops/SkPathOpsConic.cpp

Issue 1405383004: fix path op conic bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix w cast Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsConic.cpp
diff --git a/src/pathops/SkPathOpsConic.cpp b/src/pathops/SkPathOpsConic.cpp
index f80af036ee20fdd29cfc08bf369c3be21a2c1e78..86bad262e32ba4f72ac7f9949f4556ab814efce9 100644
--- a/src/pathops/SkPathOpsConic.cpp
+++ b/src/pathops/SkPathOpsConic.cpp
@@ -153,13 +153,8 @@ SkDConic SkDConic::subDivide(double t1, double t2) const {
double bx = 2 * dx - (ax + cx) / 2;
double by = 2 * dy - (ay + cy) / 2;
double bz = 2 * dz - (az + cz) / 2;
- SkDConic dst = {{{{ax / az, ay / az}, {bx / bz, by / bz}, {cx / cz, cy / cz}}}, 0 };
- SkDPoint dMidAC = { (dst.fPts[0].fX + dst.fPts[2].fX) / 2,
- (dst.fPts[0].fY + dst.fPts[2].fY) / 2 };
- SkDPoint dMid = { dx / dz, dy / dz };
- SkDVector dWNumer = dMidAC - dMid;
- SkDVector dWDenom = dMid - dst.fPts[1];
- dst.fWeight = dWNumer.length() / dWDenom.length();
+ SkDConic dst = {{{{ax / az, ay / az}, {bx / bz, by / bz}, {cx / cz, cy / cz}}},
+ SkDoubleToScalar(bz / sqrt(az * cz)) };
return dst;
}
« no previous file with comments | « src/pathops/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698