diff options
author | caryclark <caryclark@google.com> | 2015-04-20 08:31:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-20 08:31:59 -0700 |
commit | 1049f1246e7be4ccb68001361efceb8933e6f81c (patch) | |
tree | 9c71ceb245856cbe2173913eaec3b0ebb490dd74 /src/pathops/SkOpSpan.cpp | |
parent | 5c476fb2776639bdbf0e974dd38d1c5d4c4ff1aa (diff) |
Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops.
TBR=reed
BUG=skia:3588
Review URL: https://codereview.chromium.org/1037953004
Diffstat (limited to 'src/pathops/SkOpSpan.cpp')
-rwxr-xr-x | src/pathops/SkOpSpan.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp index 37d5120019..32d2376a0f 100755 --- a/src/pathops/SkOpSpan.cpp +++ b/src/pathops/SkOpSpan.cpp @@ -28,7 +28,7 @@ void SkOpPtT::init(SkOpSpanBase* span, double t, const SkPoint& pt, bool duplica fNext = this; fDuplicatePt = duplicate; fDeleted = false; - PATH_OPS_DEBUG_CODE(fID = span->globalState()->nextPtTID()); + SkDEBUGCODE(fID = span->globalState()->nextPtTID()); } bool SkOpPtT::onEnd() const { @@ -89,13 +89,15 @@ SkOpSegment* SkOpPtT::segment() { // find the starting or ending span with an existing loop of angles // OPTIMIZE? remove the spans pointing to windValue==0 here or earlier? // FIXME? assert that only one other span has a valid windValue or oppValue -void SkOpSpanBase::addSimpleAngle(bool checkFrom, SkChunkAlloc* allocator) { +bool SkOpSpanBase::addSimpleAngle(bool checkFrom, SkChunkAlloc* allocator) { SkOpAngle* angle; if (checkFrom) { - SkASSERT(this->final()); + if (!this->final()) { + return false; + } if (this->fromAngle()) { SkASSERT(this->fromAngle()->loopCount() == 2); - return; + return true; } angle = this->segment()->addEndSpan(allocator); } else { @@ -105,7 +107,7 @@ void SkOpSpanBase::addSimpleAngle(bool checkFrom, SkChunkAlloc* allocator) { SkASSERT(span->toAngle()->loopCount() == 2); SkASSERT(!span->fromAngle()); span->setFromAngle(span->toAngle()->next()); - return; + return true; } angle = this->segment()->addStartSpan(allocator); } @@ -140,6 +142,7 @@ void SkOpSpanBase::addSimpleAngle(bool checkFrom, SkChunkAlloc* allocator) { SkASSERT(oAngle == oSpanBase->fromAngle()); } angle->insert(oAngle); + return true; } void SkOpSpanBase::align() { @@ -274,8 +277,8 @@ void SkOpSpanBase::initBase(SkOpSegment* segment, SkOpSpan* prev, double t, cons fPrev = prev; fAligned = true; fChased = false; - PATH_OPS_DEBUG_CODE(fCount = 1); - PATH_OPS_DEBUG_CODE(fID = globalState()->nextSpanID()); + SkDEBUGCODE(fCount = 1); + SkDEBUGCODE(fID = globalState()->nextSpanID()); } // this pair of spans share a common t value or point; merge them and eliminate duplicates |