Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SkOpSpanBase Class Reference

#include <SkOpSpan.h>

Inheritance diagram for SkOpSpanBase:
SkOpSpan

Public Types

enum class  Collapsed { kNo , kYes , kError }
 

Public Member Functions

bool addOpp (SkOpSpanBase *opp)
 
void bumpSpanAdds ()
 
bool chased () const
 
void checkForCollapsedCoincidence ()
 
const SkOpSpanBasecoinEnd () const
 
Collapsed collapsed (double s, double e) const
 
bool contains (const SkOpSpanBase *) const
 
const SkOpPtTcontains (const SkOpSegment *) const
 
bool containsCoinEnd (const SkOpSpanBase *coin) const
 
bool containsCoinEnd (const SkOpSegment *) const
 
SkOpContourcontour () const
 
int debugBumpCount ()
 
int debugID () const
 
bool debugAlignedEnd (double t, const SkPoint &pt) const
 
bool debugAlignedInner () const
 
const SkOpAngledebugAngle (int id) const
 
const SkOpCoincidencedebugCoincidence () const
 
bool debugCoinEndLoopCheck () const
 
SkOpContourdebugContour (int id) const
 
const SkOpPtTdebugPtT (int id) const
 
void debugResetCoinT () const
 
const SkOpSegmentdebugSegment (int id) const
 
void debugSetCoinT (int) const
 
const SkOpSpanBasedebugSpan (int id) const
 
const SkOpSpandebugStarter (SkOpSpanBase const **endPtr) const
 
SkOpGlobalStateglobalState () const
 
void debugValidate () const
 
bool deleted () const
 
void dump () const
 
void dumpCoin () const
 
void dumpAll () const
 
void dumpBase () const
 
void dumpHead () const
 
bool final () const
 
SkOpAnglefromAngle () const
 
void initBase (SkOpSegment *parent, SkOpSpan *prev, double t, const SkPoint &pt)
 
void insertCoinEnd (SkOpSpanBase *coin)
 
void merge (SkOpSpan *span)
 
bool mergeMatches (SkOpSpanBase *opp)
 
const SkOpSpanprev () const
 
SkOpSpanprev ()
 
const SkPointpt () const
 
const SkOpPtTptT () const
 
SkOpPtTptT ()
 
SkOpSegmentsegment () const
 
void setAligned ()
 
void setChased (bool chased)
 
void setFromAngle (SkOpAngle *angle)
 
void setPrev (SkOpSpan *prev)
 
bool simple () const
 
int spanAddsCount () const
 
const SkOpSpanstarter (const SkOpSpanBase *end) const
 
SkOpSpanstarter (SkOpSpanBase *end)
 
SkOpSpanstarter (SkOpSpanBase **endPtr)
 
int step (const SkOpSpanBase *end) const
 
double t () const
 
void unaligned ()
 
SkOpSpanupCast ()
 
const SkOpSpanupCast () const
 
SkOpSpanupCastable ()
 
const SkOpSpanupCastable () const
 

Protected Member Functions

 SkDEBUGCODE (int fCount;) SkDEBUGCODE(int fID
 

Protected Attributes

SkOpPtT fPtT
 
SkOpSegmentfSegment
 
SkOpSpanBasefCoinEnd
 
SkOpAnglefFromAngle
 
SkOpSpanfPrev
 
int fSpanAdds
 
bool fAligned
 
bool fChased
 

Detailed Description

Definition at line 178 of file SkOpSpan.h.

Member Enumeration Documentation

◆ Collapsed

enum class SkOpSpanBase::Collapsed
strong
Enumerator
kNo 
kYes 
kError 

Definition at line 180 of file SkOpSpan.h.

Member Function Documentation

◆ addOpp()

bool SkOpSpanBase::addOpp ( SkOpSpanBase opp)

Definition at line 158 of file SkOpSpan.cpp.

158 {
159 SkOpPtT* oppPrev = this->ptT()->oppPrev(opp->ptT());
160 if (!oppPrev) {
161 return true;
162 }
163 FAIL_IF(!this->mergeMatches(opp));
164 this->ptT()->addOpp(opp->ptT(), oppPrev);
166 return true;
167}
#define FAIL_IF(cond)
SkOpPtT * oppPrev(const SkOpPtT *opp) const
Definition SkOpSpan.h:104
void addOpp(SkOpPtT *opp, SkOpPtT *oppPrev)
Definition SkOpSpan.h:34
bool mergeMatches(SkOpSpanBase *opp)
Definition SkOpSpan.cpp:313
void checkForCollapsedCoincidence()
Definition SkOpSpan.cpp:288
const SkOpPtT * ptT() const
Definition SkOpSpan.h:310

◆ bumpSpanAdds()

void SkOpSpanBase::bumpSpanAdds ( )
inline

Definition at line 188 of file SkOpSpan.h.

188 {
189 ++fSpanAdds;
190 }

◆ chased()

bool SkOpSpanBase::chased ( ) const
inline

Definition at line 192 of file SkOpSpan.h.

192 {
193 return fChased;
194 }

◆ checkForCollapsedCoincidence()

void SkOpSpanBase::checkForCollapsedCoincidence ( )

Definition at line 288 of file SkOpSpan.cpp.

288 {
289 SkOpCoincidence* coins = this->globalState()->coincidence();
290 if (coins->isEmpty()) {
291 return;
292 }
293// the insert above may have put both ends of a coincident run in the same span
294// for each coincident ptT in loop; see if its opposite in is also in the loop
295// this implementation is the motivation for marking that a ptT is referenced by a coincident span
296 SkOpPtT* head = this->ptT();
297 SkOpPtT* test = head;
298 do {
299 if (!test->coincident()) {
300 continue;
301 }
302 coins->markCollapsed(test);
303 } while ((test = test->next()) != head);
304 coins->releaseDeleted();
305}
void markCollapsed(SkOpPtT *)
bool isEmpty() const
SkOpCoincidence * coincidence()
SkOpGlobalState * globalState() const
Definition SkOpSpan.cpp:239

◆ coinEnd()

const SkOpSpanBase * SkOpSpanBase::coinEnd ( ) const
inline

Definition at line 198 of file SkOpSpan.h.

198 {
199 return fCoinEnd;
200 }
SkOpSpanBase * fCoinEnd
Definition SkOpSpan.h:407

◆ collapsed()

SkOpSpanBase::Collapsed SkOpSpanBase::collapsed ( double  s,
double  e 
) const

Definition at line 169 of file SkOpSpan.cpp.

169 {
170 const SkOpPtT* start = &fPtT;
171 const SkOpPtT* startNext = nullptr;
172 const SkOpPtT* walk = start;
173 double min = walk->fT;
174 double max = min;
175 const SkOpSegment* segment = this->segment();
176 int safetyNet = 100000;
177 while ((walk = walk->next()) != start) {
178 if (!--safetyNet) {
179 return Collapsed::kError;
180 }
181 if (walk == startNext) {
182 return Collapsed::kError;
183 }
184 if (walk->segment() != segment) {
185 continue;
186 }
187 min = std::min(min, walk->fT);
188 max = std::max(max, walk->fT);
189 if (between(min, s, max) && between(min, e, max)) {
190 return Collapsed::kYes;
191 }
192 startNext = start->next();
193 }
194 return Collapsed::kNo;
195}
static bool between(SkScalar a, SkScalar b, SkScalar c)
const SkOpPtT * next() const
Definition SkOpSpan.h:93
double fT
Definition SkOpSpan.h:166
const SkOpSegment * segment() const
Definition SkOpSpan.cpp:144
SkOpPtT fPtT
Definition SkOpSpan.h:405
SkOpSegment * segment() const
Definition SkOpSpan.h:318
struct MyStruct s
static float max(float r, float g, float b)
Definition hsl.cpp:49
static float min(float r, float g, float b)
Definition hsl.cpp:48

◆ contains() [1/2]

const SkOpPtT * SkOpSpanBase::contains ( const SkOpSegment segment) const

Definition at line 210 of file SkOpSpan.cpp.

210 {
211 const SkOpPtT* start = &fPtT;
212 const SkOpPtT* walk = start;
213 while ((walk = walk->next()) != start) {
214 if (walk->deleted()) {
215 continue;
216 }
217 if (walk->segment() == segment && walk->span()->ptT() == walk) {
218 return walk;
219 }
220 }
221 return nullptr;
222}
const SkOpSpanBase * span() const
Definition SkOpSpan.h:154
bool deleted() const
Definition SkOpSpan.h:71

◆ contains() [2/2]

bool SkOpSpanBase::contains ( const SkOpSpanBase span) const

Definition at line 197 of file SkOpSpan.cpp.

197 {
198 const SkOpPtT* start = &fPtT;
199 const SkOpPtT* check = &span->fPtT;
201 const SkOpPtT* walk = start;
202 while ((walk = walk->next()) != start) {
203 if (walk == check) {
204 return true;
205 }
206 }
207 return false;
208}
#define check(reporter, ref, unref, make, kill)
#define SkOPASSERT(cond)

◆ containsCoinEnd() [1/2]

bool SkOpSpanBase::containsCoinEnd ( const SkOpSegment segment) const

Definition at line 224 of file SkOpSpan.cpp.

224 {
225 SkASSERT(this->segment() != segment);
226 const SkOpSpanBase* next = this;
227 while ((next = next->fCoinEnd) != this) {
228 if (next->segment() == segment) {
229 return true;
230 }
231 }
232 return false;
233}
static float next(float f)
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ containsCoinEnd() [2/2]

bool SkOpSpanBase::containsCoinEnd ( const SkOpSpanBase coin) const
inline

Definition at line 206 of file SkOpSpan.h.

206 {
207 SkASSERT(this != coin);
208 const SkOpSpanBase* next = this;
209 while ((next = next->fCoinEnd) != this) {
210 if (next == coin) {
211 return true;
212 }
213 }
214 return false;
215 }

◆ contour()

SkOpContour * SkOpSpanBase::contour ( ) const

Definition at line 235 of file SkOpSpan.cpp.

235 {
236 return segment()->contour();
237}
SkOpContour * contour() const

◆ debugAlignedEnd()

bool SkOpSpanBase::debugAlignedEnd ( double  t,
const SkPoint pt 
) const

◆ debugAlignedInner()

bool SkOpSpanBase::debugAlignedInner ( ) const

◆ debugAngle()

const SkOpAngle * SkOpSpanBase::debugAngle ( int  id) const

Definition at line 718 of file PathOpsDebug.cpp.

718 {
719 return this->segment()->debugAngle(id);
720}
const SkOpAngle * debugAngle(int id) const

◆ debugBumpCount()

int SkOpSpanBase::debugBumpCount ( )
inline

Definition at line 220 of file SkOpSpan.h.

220 {
221 return SkDEBUGRELEASE(++fCount, -1);
222 }
#define SkDEBUGRELEASE(a, b)

◆ debugCoincidence()

const SkOpCoincidence * SkOpSpanBase::debugCoincidence ( ) const

Definition at line 722 of file PathOpsDebug.cpp.

722 {
723 return this->segment()->debugCoincidence();
724}
const SkOpCoincidence * debugCoincidence() const

◆ debugCoinEndLoopCheck()

bool SkOpSpanBase::debugCoinEndLoopCheck ( ) const

Definition at line 2413 of file SkPathOpsDebug.cpp.

2413 {
2414 int loop = 0;
2415 const SkOpSpanBase* next = this;
2416 SkOpSpanBase* nextCoin;
2417 do {
2418 nextCoin = next->fCoinEnd;
2419 SkASSERT(nextCoin == this || nextCoin->fCoinEnd != nextCoin);
2420 for (int check = 1; check < loop - 1; ++check) {
2421 const SkOpSpanBase* checkCoin = this->fCoinEnd;
2422 const SkOpSpanBase* innerCoin = checkCoin;
2423 for (int inner = check + 1; inner < loop; ++inner) {
2424 innerCoin = innerCoin->fCoinEnd;
2425 if (checkCoin == innerCoin) {
2426 SkDebugf("*** bad coincident end loop ***\n");
2427 return false;
2428 }
2429 }
2430 }
2431 ++loop;
2432 } while ((next = nextCoin) && next != this);
2433 return true;
2434}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1

◆ debugContour()

SkOpContour * SkOpSpanBase::debugContour ( int  id) const

Definition at line 726 of file PathOpsDebug.cpp.

726 {
727 return this->segment()->debugContour(id);
728}
SkOpContour * debugContour(int id) const

◆ debugID()

int SkOpSpanBase::debugID ( ) const
inline

Definition at line 224 of file SkOpSpan.h.

224 {
225 return SkDEBUGRELEASE(fID, -1);
226 }

◆ debugPtT()

const SkOpPtT * SkOpSpanBase::debugPtT ( int  id) const

Definition at line 730 of file PathOpsDebug.cpp.

730 {
731 return this->segment()->debugPtT(id);
732}
const SkOpPtT * debugPtT(int id) const

◆ debugResetCoinT()

void SkOpSpanBase::debugResetCoinT ( ) const

Definition at line 2522 of file SkPathOpsDebug.cpp.

2522 {
2523#if DEBUG_COINCIDENCE_ORDER
2524 const SkOpPtT* ptT = &fPtT;
2525 do {
2527 ptT = ptT->next();
2528 } while (ptT != &fPtT);
2529#endif
2530}
void debugResetCoinT() const

◆ debugSegment()

const SkOpSegment * SkOpSpanBase::debugSegment ( int  id) const

Definition at line 734 of file PathOpsDebug.cpp.

734 {
735 return this->segment()->debugSegment(id);
736}
const SkOpSegment * debugSegment(int id) const

◆ debugSetCoinT()

void SkOpSpanBase::debugSetCoinT ( int  index) const

Definition at line 2532 of file SkPathOpsDebug.cpp.

2532 {
2533#if DEBUG_COINCIDENCE_ORDER
2534 const SkOpPtT* ptT = &fPtT;
2535 do {
2536 if (!ptT->deleted()) {
2537 ptT->debugSetCoinT(index);
2538 }
2539 ptT = ptT->next();
2540 } while (ptT != &fPtT);
2541#endif
2542}
void debugSetCoinT(int) const

◆ debugSpan()

const SkOpSpanBase * SkOpSpanBase::debugSpan ( int  id) const

Definition at line 738 of file PathOpsDebug.cpp.

738 {
739 return this->segment()->debugSpan(id);
740}
const SkOpSpanBase * debugSpan(int id) const

◆ debugStarter()

const SkOpSpan * SkOpSpanBase::debugStarter ( SkOpSpanBase const **  endPtr) const

Definition at line 2544 of file SkPathOpsDebug.cpp.

2544 {
2545 const SkOpSpanBase* end = *endPtr;
2546 SkASSERT(this->segment() == end->segment());
2547 const SkOpSpanBase* result;
2548 if (t() < end->t()) {
2549 result = this;
2550 } else {
2551 result = end;
2552 *endPtr = this;
2553 }
2554 return result->upCast();
2555}
double t() const
Definition SkOpSpan.h:375
SkOpSpan * upCast()
Definition SkOpSpan.h:383
glong glong end
GAsyncResult * result

◆ debugValidate()

void SkOpSpanBase::debugValidate ( ) const

Definition at line 2557 of file SkPathOpsDebug.cpp.

2557 {
2558#if DEBUG_COINCIDENCE
2559 if (this->globalState()->debugCheckHealth()) {
2560 return;
2561 }
2562#endif
2563#if DEBUG_VALIDATE
2564 const SkOpPtT* ptT = &fPtT;
2565 SkASSERT(ptT->span() == this);
2566 do {
2567// SkASSERT(SkDPoint::RoughlyEqual(fPtT.fPt, ptT->fPt));
2568 ptT->debugValidate();
2569 ptT = ptT->next();
2570 } while (ptT != &fPtT);
2572 if (!this->final()) {
2573 SkASSERT(this->upCast()->debugCoinLoopCheck());
2574 }
2575 if (fFromAngle) {
2577 }
2578 if (!this->final() && this->upCast()->toAngle()) {
2579 this->upCast()->toAngle()->debugValidate();
2580 }
2581#endif
2582}
void debugValidate() const
void debugValidate() const
SkOpAngle * fFromAngle
Definition SkOpSpan.h:408
bool debugCoinEndLoopCheck() const
SkOpAngle * toAngle() const
Definition SkOpSpan.h:550

◆ deleted()

bool SkOpSpanBase::deleted ( ) const
inline

Definition at line 261 of file SkOpSpan.h.

261 {
262 return fPtT.deleted();
263 }

◆ dump()

void SkOpSpanBase::dump ( ) const

Definition at line 742 of file PathOpsDebug.cpp.

742 {
743 this->dumpHead();
744 this->fPtT.dump();
745}
void dump() const
void dumpHead() const

◆ dumpAll()

void SkOpSpanBase::dumpAll ( ) const

Definition at line 754 of file PathOpsDebug.cpp.

754 {
755 this->dumpHead();
756 this->fPtT.dumpAll();
757}
void dumpAll() const

◆ dumpBase()

void SkOpSpanBase::dumpBase ( ) const

Definition at line 759 of file PathOpsDebug.cpp.

759 {
760 if (this->fAligned) {
761 SkDebugf(" aligned");
762 }
763 if (this->fChased) {
764 SkDebugf(" chased");
765 }
766#ifdef SK_DEBUG
767 if (this->fDebugDeleted) {
768 SkDebugf(" deleted");
769 }
770#endif
771 if (!this->final()) {
772 this->upCast()->dumpSpan();
773 }
774 const SkOpSpanBase* coin = this->coinEnd();
775 if (this != coin) {
776 SkDebugf(" coinEnd seg/span=%d/%d", coin->segment()->debugID(), coin->debugID());
777 } else if (this->final() || !this->upCast()->isCoincident()) {
778 const SkOpPtT* oPt = this->ptT()->next();
779 SkDebugf(" seg/span=%d/%d", oPt->segment()->debugID(), oPt->span()->debugID());
780 }
781 SkDebugf(" adds=%d", fSpanAdds);
782}
int debugID() const
bool fAligned
Definition SkOpSpan.h:411
const SkOpSpanBase * coinEnd() const
Definition SkOpSpan.h:198
int debugID() const
Definition SkOpSpan.h:224
bool dumpSpan() const

◆ dumpCoin()

void SkOpSpanBase::dumpCoin ( ) const

Definition at line 784 of file PathOpsDebug.cpp.

784 {
785 const SkOpSpan* span = this->upCastable();
786 if (!span) {
787 return;
788 }
789 if (!span->isCoincident()) {
790 return;
791 }
792 span->dumpCoin();
793}
SkOpSpan * upCastable()
Definition SkOpSpan.h:393
void dumpCoin() const
bool isCoincident() const
Definition SkOpSpan.h:486

◆ dumpHead()

void SkOpSpanBase::dumpHead ( ) const

Definition at line 747 of file PathOpsDebug.cpp.

747 {
748 SkDebugf("%.*s", contour()->debugIndent(), " ");
749 SkDebugf("seg=%d span=%d", this->segment()->debugID(), this->debugID());
750 this->dumpBase();
751 SkDebugf("\n");
752}
SkOpContour * contour() const
Definition SkOpSpan.cpp:235
void dumpBase() const

◆ final()

bool SkOpSpanBase::final ( ) const
inline

Definition at line 271 of file SkOpSpan.h.

271 {
272 return fPtT.fT == 1;
273 }

◆ fromAngle()

SkOpAngle * SkOpSpanBase::fromAngle ( ) const
inline

Definition at line 275 of file SkOpSpan.h.

275 {
276 return fFromAngle;
277 }

◆ globalState()

SkOpGlobalState * SkOpSpanBase::globalState ( ) const

Definition at line 239 of file SkOpSpan.cpp.

239 {
240 return contour()->globalState();
241}
SkOpGlobalState * globalState() const

◆ initBase()

void SkOpSpanBase::initBase ( SkOpSegment parent,
SkOpSpan prev,
double  t,
const SkPoint pt 
)

Definition at line 243 of file SkOpSpan.cpp.

243 {
245 fPtT.init(this, t, pt, false);
246 fCoinEnd = this;
247 fFromAngle = nullptr;
248 fPrev = prev;
249 fSpanAdds = 0;
250 fAligned = true;
251 fChased = false;
252 SkDEBUGCODE(fCount = 1);
253 SkDEBUGCODE(fID = globalState()->nextSpanID());
254 SkDEBUGCODE(fDebugDeleted = false);
255}
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
void init(SkOpSpanBase *, double t, const SkPoint &, bool dup)
Definition SkOpSpan.cpp:104
const SkPoint & pt() const
Definition SkOpSpan.h:306
const SkOpSpan * prev() const
Definition SkOpSpan.h:298
SkOpSpan * fPrev
Definition SkOpSpan.h:409
SkOpSegment * fSegment
Definition SkOpSpan.h:406

◆ insertCoinEnd()

void SkOpSpanBase::insertCoinEnd ( SkOpSpanBase coin)
inline

Definition at line 282 of file SkOpSpan.h.

282 {
283 if (containsCoinEnd(coin)) {
284 SkASSERT(coin->containsCoinEnd(this));
285 return;
286 }
288 SkASSERT(this != coin);
289 SkOpSpanBase* coinNext = coin->fCoinEnd;
290 coin->fCoinEnd = this->fCoinEnd;
291 this->fCoinEnd = coinNext;
293 }
void debugValidate() const
bool containsCoinEnd(const SkOpSpanBase *coin) const
Definition SkOpSpan.h:206

◆ merge()

void SkOpSpanBase::merge ( SkOpSpan span)

Definition at line 259 of file SkOpSpan.cpp.

259 {
260 SkOpPtT* spanPtT = span->ptT();
261 SkASSERT(this->t() != spanPtT->fT);
262 SkASSERT(!zero_or_one(spanPtT->fT));
263 span->release(this->ptT());
264 if (this->contains(span)) {
265 SkOPASSERT(0); // check to see if this ever happens -- should have been found earlier
266 return; // merge is already in the ptT loop
267 }
268 SkOpPtT* remainder = spanPtT->next();
269 this->ptT()->insert(spanPtT);
270 while (remainder != spanPtT) {
271 SkOpPtT* next = remainder->next();
272 SkOpPtT* compare = spanPtT->next();
273 while (compare != spanPtT) {
274 SkOpPtT* nextC = compare->next();
275 if (nextC->span() == remainder->span() && nextC->fT == remainder->fT) {
276 goto tryNextRemainder;
277 }
278 compare = nextC;
279 }
280 spanPtT->insert(remainder);
281tryNextRemainder:
282 remainder = next;
283 }
284 fSpanAdds += span->fSpanAdds;
285}
static bool compare(const SkBitmap &ref, const SkIRect &iref, const SkBitmap &test, const SkIRect &itest)
Definition BlurTest.cpp:100
bool zero_or_one(double x)
void insert(SkOpPtT *span)
Definition SkOpSpan.h:87
bool contains(const SkOpSpanBase *) const
Definition SkOpSpan.cpp:197
void release(const SkOpPtT *)
Definition SkOpSpan.cpp:446

◆ mergeMatches()

bool SkOpSpanBase::mergeMatches ( SkOpSpanBase opp)

Definition at line 313 of file SkOpSpan.cpp.

313 {
314 SkOpPtT* test = &fPtT;
315 SkOpPtT* testNext;
316 const SkOpPtT* stop = test;
317 int safetyHatch = 1000000;
318 do {
319 if (!--safetyHatch) {
320 return false;
321 }
322 testNext = test->next();
323 if (test->deleted()) {
324 continue;
325 }
326 SkOpSpanBase* testBase = test->span();
327 SkASSERT(testBase->ptT() == test);
328 SkOpSegment* segment = test->segment();
329 if (segment->done()) {
330 continue;
331 }
332 SkOpPtT* inner = opp->ptT();
333 const SkOpPtT* innerStop = inner;
334 do {
335 if (inner->segment() != segment) {
336 continue;
337 }
338 if (inner->deleted()) {
339 continue;
340 }
341 SkOpSpanBase* innerBase = inner->span();
342 SkASSERT(innerBase->ptT() == inner);
343 // when the intersection is first detected, the span base is marked if there are
344 // more than one point in the intersection.
345 if (!zero_or_one(inner->fT)) {
346 innerBase->upCast()->release(test);
347 } else {
348 SkOPASSERT(inner->fT != test->fT);
349 if (!zero_or_one(test->fT)) {
350 testBase->upCast()->release(inner);
351 } else {
352 segment->markAllDone(); // mark segment as collapsed
353 SkDEBUGCODE(testBase->debugSetDeleted());
354 test->setDeleted();
355 SkDEBUGCODE(innerBase->debugSetDeleted());
356 inner->setDeleted();
357 }
358 }
359#ifdef SK_DEBUG // assert if another undeleted entry points to segment
360 const SkOpPtT* debugInner = inner;
361 while ((debugInner = debugInner->next()) != innerStop) {
362 if (debugInner->segment() != segment) {
363 continue;
364 }
365 if (debugInner->deleted()) {
366 continue;
367 }
368 SkOPASSERT(0);
369 }
370#endif
371 break;
372 } while ((inner = inner->next()) != innerStop);
373 } while ((test = testNext) != stop);
375 return true;
376}
#define test(name)
void setDeleted()
Definition SkOpSpan.cpp:152
bool done() const
void markAllDone()

◆ prev() [1/2]

SkOpSpan * SkOpSpanBase::prev ( )
inline

Definition at line 302 of file SkOpSpan.h.

302 {
303 return fPrev;
304 }

◆ prev() [2/2]

const SkOpSpan * SkOpSpanBase::prev ( ) const
inline

Definition at line 298 of file SkOpSpan.h.

298 {
299 return fPrev;
300 }

◆ pt()

const SkPoint & SkOpSpanBase::pt ( ) const
inline

Definition at line 306 of file SkOpSpan.h.

306 {
307 return fPtT.fPt;
308 }
SkPoint fPt
Definition SkOpSpan.h:167

◆ ptT() [1/2]

SkOpPtT * SkOpSpanBase::ptT ( )
inline

Definition at line 314 of file SkOpSpan.h.

314 {
315 return &fPtT;
316 }

◆ ptT() [2/2]

const SkOpPtT * SkOpSpanBase::ptT ( ) const
inline

Definition at line 310 of file SkOpSpan.h.

310 {
311 return &fPtT;
312 }

◆ segment()

SkOpSegment * SkOpSpanBase::segment ( ) const
inline

Definition at line 318 of file SkOpSpan.h.

318 {
319 return fSegment;
320 }

◆ setAligned()

void SkOpSpanBase::setAligned ( )
inline

Definition at line 322 of file SkOpSpan.h.

322 {
323 fAligned = true;
324 }

◆ setChased()

void SkOpSpanBase::setChased ( bool  chased)
inline

Definition at line 326 of file SkOpSpan.h.

326 {
327 fChased = chased;
328 }
bool chased() const
Definition SkOpSpan.h:192

◆ setFromAngle()

void SkOpSpanBase::setFromAngle ( SkOpAngle angle)
inline

Definition at line 330 of file SkOpSpan.h.

330 {
331 fFromAngle = angle;
332 }

◆ setPrev()

void SkOpSpanBase::setPrev ( SkOpSpan prev)
inline

Definition at line 334 of file SkOpSpan.h.

334 {
335 fPrev = prev;
336 }

◆ simple()

bool SkOpSpanBase::simple ( ) const
inline

Definition at line 338 of file SkOpSpan.h.

338 {
340 return fPtT.next()->next() == &fPtT;
341 }

◆ SkDEBUGCODE()

SkOpSpanBase::SkDEBUGCODE ( int fCount;  )
protected

◆ spanAddsCount()

int SkOpSpanBase::spanAddsCount ( ) const
inline

Definition at line 343 of file SkOpSpan.h.

343 {
344 return fSpanAdds;
345 }

◆ starter() [1/3]

const SkOpSpan * SkOpSpanBase::starter ( const SkOpSpanBase end) const
inline

Definition at line 347 of file SkOpSpan.h.

347 {
348 const SkOpSpanBase* result = t() < end->t() ? this : end;
349 return result->upCast();
350 }

◆ starter() [2/3]

SkOpSpan * SkOpSpanBase::starter ( SkOpSpanBase **  endPtr)
inline

Definition at line 358 of file SkOpSpan.h.

358 {
359 SkOpSpanBase* end = *endPtr;
360 SkASSERT(this->segment() == end->segment());
362 if (t() < end->t()) {
363 result = this;
364 } else {
365 result = end;
366 *endPtr = this;
367 }
368 return result->upCast();
369 }

◆ starter() [3/3]

SkOpSpan * SkOpSpanBase::starter ( SkOpSpanBase end)
inline

Definition at line 352 of file SkOpSpan.h.

352 {
353 SkASSERT(this->segment() == end->segment());
354 SkOpSpanBase* result = t() < end->t() ? this : end;
355 return result->upCast();
356 }

◆ step()

int SkOpSpanBase::step ( const SkOpSpanBase end) const
inline

Definition at line 371 of file SkOpSpan.h.

371 {
372 return t() < end->t() ? 1 : -1;
373 }

◆ t()

double SkOpSpanBase::t ( ) const
inline

Definition at line 375 of file SkOpSpan.h.

375 {
376 return fPtT.fT;
377 }

◆ unaligned()

void SkOpSpanBase::unaligned ( )
inline

Definition at line 379 of file SkOpSpan.h.

379 {
380 fAligned = false;
381 }

◆ upCast() [1/2]

SkOpSpan * SkOpSpanBase::upCast ( )
inline

Definition at line 383 of file SkOpSpan.h.

383 {
384 SkASSERT(!final());
385 return (SkOpSpan*) this;
386 }

◆ upCast() [2/2]

const SkOpSpan * SkOpSpanBase::upCast ( ) const
inline

Definition at line 388 of file SkOpSpan.h.

388 {
389 SkOPASSERT(!final());
390 return (const SkOpSpan*) this;
391 }

◆ upCastable() [1/2]

SkOpSpan * SkOpSpanBase::upCastable ( )
inline

Definition at line 393 of file SkOpSpan.h.

393 {
394 return final() ? nullptr : upCast();
395 }

◆ upCastable() [2/2]

const SkOpSpan * SkOpSpanBase::upCastable ( ) const
inline

Definition at line 397 of file SkOpSpan.h.

397 {
398 return final() ? nullptr : upCast();
399 }

Member Data Documentation

◆ fAligned

bool SkOpSpanBase::fAligned
protected

Definition at line 411 of file SkOpSpan.h.

◆ fChased

bool SkOpSpanBase::fChased
protected

Definition at line 412 of file SkOpSpan.h.

◆ fCoinEnd

SkOpSpanBase* SkOpSpanBase::fCoinEnd
protected

Definition at line 407 of file SkOpSpan.h.

◆ fFromAngle

SkOpAngle* SkOpSpanBase::fFromAngle
protected

Definition at line 408 of file SkOpSpan.h.

◆ fPrev

SkOpSpan* SkOpSpanBase::fPrev
protected

Definition at line 409 of file SkOpSpan.h.

◆ fPtT

SkOpPtT SkOpSpanBase::fPtT
protected

Definition at line 405 of file SkOpSpan.h.

◆ fSegment

SkOpSegment* SkOpSpanBase::fSegment
protected

Definition at line 406 of file SkOpSpan.h.

◆ fSpanAdds

int SkOpSpanBase::fSpanAdds
protected

Definition at line 410 of file SkOpSpan.h.


The documentation for this class was generated from the following files: