summaryrefslogtreecommitdiff
path: root/pathops/SkPathOpsCubic.cpp
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-14 17:08:59 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-14 17:08:59 +0000
commit017596eb7161200e1370b4f4a2994b713535788a (patch)
tree6d77977a9f4616e79718be89f2387766cbaaf748 /pathops/SkPathOpsCubic.cpp
parentbed7c919df8c68e529f98a536f02bf29b79697e9 (diff)
downloadsrc-017596eb7161200e1370b4f4a2994b713535788a.tar.gz
Mike R: please sanity check SkPostConfig.h
Mike K: please sanity check Test.cpp and skia_test.cpp Feel free to look at the rest, but I don't expect any in depth review of path ops innards. Path Ops first iteration used QuickSort to order segments radiating from an intersection to compute the winding rule. This revision uses a circular sort instead. Breaking out the circular sort into its own long-lived structure (SkOpAngle) allows doing less work and provides a home for caching additional sorting data. The circle sort is more stable than the former sort, has a robust ordering and fewer exceptions. It finds unsortable ordering less often. It is less reliant on the initial curve tangent, using convex hulls instead whenever it can. Additional debug validation makes sure that the computed structures are self-consistent. A new visualization tool helps verify that the angle ordering is correct. The 70+M tests pass with this change on Windows, Mac, Linux 32 and Linux 64 in debug and release. R=mtklein@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/131103009 git-svn-id: http://skia.googlecode.com/svn/trunk/src@14183 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'pathops/SkPathOpsCubic.cpp')
-rw-r--r--pathops/SkPathOpsCubic.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/pathops/SkPathOpsCubic.cpp b/pathops/SkPathOpsCubic.cpp
index 8e8ec47b..fda42a31 100644
--- a/pathops/SkPathOpsCubic.cpp
+++ b/pathops/SkPathOpsCubic.cpp
@@ -455,16 +455,16 @@ void SkDCubic::subDivide(const SkDPoint& a, const SkDPoint& d,
if (t1 == 1 || t2 == 1) {
align(3, 2, t1 == 1 ? &dst[0] : &dst[1]);
}
- if (precisely_subdivide_equal(dst[0].fX, a.fX)) {
+ if (AlmostBequalUlps(dst[0].fX, a.fX)) {
dst[0].fX = a.fX;
}
- if (precisely_subdivide_equal(dst[0].fY, a.fY)) {
+ if (AlmostBequalUlps(dst[0].fY, a.fY)) {
dst[0].fY = a.fY;
}
- if (precisely_subdivide_equal(dst[1].fX, d.fX)) {
+ if (AlmostBequalUlps(dst[1].fX, d.fX)) {
dst[1].fX = d.fX;
}
- if (precisely_subdivide_equal(dst[1].fY, d.fY)) {
+ if (AlmostBequalUlps(dst[1].fY, d.fY)) {
dst[1].fY = d.fY;
}
}
@@ -508,16 +508,3 @@ SkDCubicPair SkDCubic::chopAt(double t) const {
interp_cubic_coords(&fPts[0].fY, &dst.pts[0].fY, t);
return dst;
}
-
-#ifdef SK_DEBUG
-void SkDCubic::dump() {
- SkDebugf("{{");
- int index = 0;
- do {
- fPts[index].dump();
- SkDebugf(", ");
- } while (++index < 3);
- fPts[index].dump();
- SkDebugf("}}\n");
-}
-#endif