OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef SkOpSegment_DEFINE | 7 #ifndef SkOpSegment_DEFINE |
8 #define SkOpSegment_DEFINE | 8 #define SkOpSegment_DEFINE |
9 | 9 |
10 #include "SkOpAngle.h" | 10 #include "SkOpAngle.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 SkOpSegment* addQuad(SkPoint pts[3], SkOpContour* parent) { | 87 SkOpSegment* addQuad(SkPoint pts[3], SkOpContour* parent) { |
88 init(pts, 1, parent, SkPath::kQuad_Verb); | 88 init(pts, 1, parent, SkPath::kQuad_Verb); |
89 SkDCurve curve; | 89 SkDCurve curve; |
90 curve.fQuad.set(pts); | 90 curve.fQuad.set(pts); |
91 curve.setQuadBounds(pts, 1, 0, 1, &fBounds); | 91 curve.setQuadBounds(pts, 1, 0, 1, &fBounds); |
92 return this; | 92 return this; |
93 } | 93 } |
94 | 94 |
95 SkOpPtT* addT(double t, bool* allocated); | 95 SkOpPtT* addT(double t); |
96 | 96 |
97 template<typename T> T* allocateArray(int count) { | 97 template<typename T> T* allocateArray(int count) { |
98 return SkOpTAllocator<T>::AllocateArray(this->globalState()->allocator()
, count); | 98 return SkOpTAllocator<T>::AllocateArray(this->globalState()->allocator()
, count); |
99 } | 99 } |
100 | 100 |
101 const SkPathOpsBounds& bounds() const { | 101 const SkPathOpsBounds& bounds() const { |
102 return fBounds; | 102 return fBounds; |
103 } | 103 } |
104 | 104 |
105 void bumpCount() { | 105 void bumpCount() { |
(...skipping 15 matching lines...) Expand all Loading... |
121 | 121 |
122 SkOpContour* contour() const { | 122 SkOpContour* contour() const { |
123 return fContour; | 123 return fContour; |
124 } | 124 } |
125 | 125 |
126 int count() const { | 126 int count() const { |
127 return fCount; | 127 return fCount; |
128 } | 128 } |
129 | 129 |
130 void debugAddAngle(double startT, double endT); | 130 void debugAddAngle(double startT, double endT); |
131 const SkOpPtT* debugAddT(double t, bool* allocated) const; | 131 const SkOpPtT* debugAddT(double t) const; |
132 const SkOpAngle* debugAngle(int id) const; | 132 const SkOpAngle* debugAngle(int id) const; |
133 #if DEBUG_ANGLE | 133 #if DEBUG_ANGLE |
134 void debugCheckAngleCoin() const; | 134 void debugCheckAngleCoin() const; |
135 #endif | 135 #endif |
136 #if DEBUG_COINCIDENCE_VERBOSE | 136 #if DEBUG_COINCIDENCE_VERBOSE |
137 void debugCheckHealth(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 137 void debugCheckHealth(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
138 void debugClearAll(const char* id, SkPathOpsDebug::GlitchLog* glitches) cons
t; | 138 void debugClearAll(const char* id, SkPathOpsDebug::GlitchLog* glitches) cons
t; |
139 void debugClearOne(const SkOpSpan* span, const char* id, SkPathOpsDebug::Gli
tchLog* glitches) const; | 139 void debugClearOne(const SkOpSpan* span, const char* id, SkPathOpsDebug::Gli
tchLog* glitches) const; |
140 #endif | 140 #endif |
141 const SkOpCoincidence* debugCoincidence() const; | 141 const SkOpCoincidence* debugCoincidence() const; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 return &fHead; | 224 return &fHead; |
225 } | 225 } |
226 | 226 |
227 SkOpSpan* head() { | 227 SkOpSpan* head() { |
228 return &fHead; | 228 return &fHead; |
229 } | 229 } |
230 | 230 |
231 void init(SkPoint pts[], SkScalar weight, SkOpContour* parent, SkPath::Verb
verb); | 231 void init(SkPoint pts[], SkScalar weight, SkOpContour* parent, SkPath::Verb
verb); |
232 | 232 |
233 SkOpSpan* insert(SkOpSpan* prev) { | 233 SkOpSpan* insert(SkOpSpan* prev) { |
234 SkOpSpan* result = SkOpTAllocator<SkOpSpan>::Allocate(this->globalState(
)->allocator()); | 234 SkOpGlobalState* globalState = this->globalState(); |
| 235 globalState->setAllocatedOpSpan(); |
| 236 SkOpSpan* result = SkOpTAllocator<SkOpSpan>::Allocate(globalState->alloc
ator()); |
235 SkOpSpanBase* next = prev->next(); | 237 SkOpSpanBase* next = prev->next(); |
236 result->setPrev(prev); | 238 result->setPrev(prev); |
237 prev->setNext(result); | 239 prev->setNext(result); |
238 SkDEBUGCODE(result->ptT()->fT = 0); | 240 SkDEBUGCODE(result->ptT()->fT = 0); |
239 result->setNext(next); | 241 result->setNext(next); |
240 if (next) { | 242 if (next) { |
241 next->setPrev(result); | 243 next->setPrev(result); |
242 } | 244 } |
243 return result; | 245 return result; |
244 } | 246 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 mutable SkScalar fDebugBaseMin; // if > 0, the 1st t value in this seg vis-
a-vis the ref seg | 448 mutable SkScalar fDebugBaseMin; // if > 0, the 1st t value in this seg vis-
a-vis the ref seg |
447 mutable SkScalar fDebugBaseMax; | 449 mutable SkScalar fDebugBaseMax; |
448 mutable int fDebugLastIndex; | 450 mutable int fDebugLastIndex; |
449 mutable SkScalar fDebugLastMin; // if > 0, the last t -- next t val - base
has same sign | 451 mutable SkScalar fDebugLastMin; // if > 0, the last t -- next t val - base
has same sign |
450 mutable SkScalar fDebugLastMax; | 452 mutable SkScalar fDebugLastMax; |
451 #endif | 453 #endif |
452 SkDEBUGCODE(int fID); | 454 SkDEBUGCODE(int fID); |
453 }; | 455 }; |
454 | 456 |
455 #endif | 457 #endif |
OLD | NEW |