aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpSegment.h
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-08-25 11:27:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-25 11:27:17 -0700
commit29b2563afb1677515739f1d24fb27733626eca92 (patch)
tree8c447f8969688bf3e1187d1b0f1461a3e777c3cd /src/pathops/SkOpSegment.h
parentf412f0988424cb5fad48a6097c8b29b5b9c56275 (diff)
path ops stream-lining
The addT() function is a workhorse of pathops. Make it simpler, removing branches and parameters. Separate addOpp() into const and modify parts. Add more debugging that asserts if the function fails and the data is not extreme (e.g., fuzzer generated). TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2273293004 Review-Url: https://codereview.chromium.org/2273293004
Diffstat (limited to 'src/pathops/SkOpSegment.h')
-rw-r--r--src/pathops/SkOpSegment.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pathops/SkOpSegment.h b/src/pathops/SkOpSegment.h
index 312312a153..1b7aad199c 100644
--- a/src/pathops/SkOpSegment.h
+++ b/src/pathops/SkOpSegment.h
@@ -92,7 +92,7 @@ public:
return this;
}
- SkOpPtT* addT(double t, bool* allocated);
+ SkOpPtT* addT(double t);
template<typename T> T* allocateArray(int count) {
return SkOpTAllocator<T>::AllocateArray(this->globalState()->allocator(), count);
@@ -128,7 +128,7 @@ public:
}
void debugAddAngle(double startT, double endT);
- const SkOpPtT* debugAddT(double t, bool* allocated) const;
+ const SkOpPtT* debugAddT(double t) const;
const SkOpAngle* debugAngle(int id) const;
#if DEBUG_ANGLE
void debugCheckAngleCoin() const;
@@ -231,7 +231,9 @@ public:
void init(SkPoint pts[], SkScalar weight, SkOpContour* parent, SkPath::Verb verb);
SkOpSpan* insert(SkOpSpan* prev) {
- SkOpSpan* result = SkOpTAllocator<SkOpSpan>::Allocate(this->globalState()->allocator());
+ SkOpGlobalState* globalState = this->globalState();
+ globalState->setAllocatedOpSpan();
+ SkOpSpan* result = SkOpTAllocator<SkOpSpan>::Allocate(globalState->allocator());
SkOpSpanBase* next = prev->next();
result->setPrev(prev);
prev->setNext(result);