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

Unified Diff: src/pathops/SkOpSpan.cpp

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging Created 5 years, 8 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.h ('k') | src/pathops/SkPathOpsBounds.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSpan.cpp
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp
index 37d5120019dae9dc772762dd9d974626b966b6db..32d2376a0f3c60e0b65e8f965f64993a684d1ef3 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
« no previous file with comments | « src/pathops/SkOpSpan.h ('k') | src/pathops/SkPathOpsBounds.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698