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

#include <SkOpContour.h>

Inheritance diagram for SkOpContour:
SkOpContourHead

Public Member Functions

 SkOpContour ()
 
bool operator< (const SkOpContour &rh) const
 
void addConic (SkPoint pts[3], SkScalar weight)
 
void addCubic (SkPoint pts[4])
 
SkOpSegmentaddLine (SkPoint pts[2])
 
void addQuad (SkPoint pts[3])
 
SkOpSegmentappendSegment ()
 
const SkPathOpsBoundsbounds () const
 
void calcAngles ()
 
void complete ()
 
int count () const
 
int debugID () const
 
int debugIndent () const
 
const SkOpAngledebugAngle (int id) const
 
const SkOpCoincidencedebugCoincidence () const
 
SkOpContourdebugContour (int id) const
 
const SkOpPtTdebugPtT (int id) const
 
const SkOpSegmentdebugSegment (int id) const
 
const SkOpSpanBasedebugSpan (int id) const
 
SkOpGlobalStateglobalState () const
 
void debugValidate () const
 
bool done () const
 
void dump () const
 
void dumpAll () const
 
void dumpAngles () const
 
void dumpContours () const
 
void dumpContoursAll () const
 
void dumpContoursAngles () const
 
void dumpContoursPts () const
 
void dumpContoursPt (int segmentID) const
 
void dumpContoursSegment (int segmentID) const
 
void dumpContoursSpan (int segmentID) const
 
void dumpContoursSpans () const
 
void dumpPt (int) const
 
void dumpPts (const char *prefix="seg") const
 
void dumpPtsX (const char *prefix) const
 
void dumpSegment (int) const
 
void dumpSegments (const char *prefix="seg", SkPathOp op=(SkPathOp) -1) const
 
void dumpSpan (int) const
 
void dumpSpans () const
 
const SkPointend () const
 
SkOpSpanfindSortableTop (SkOpContour *)
 
SkOpSegmentfirst ()
 
const SkOpSegmentfirst () const
 
void indentDump () const
 
void init (SkOpGlobalState *globalState, bool operand, bool isXor)
 
int isCcw () const
 
bool isXor () const
 
void joinSegments ()
 
void markAllDone ()
 
bool missingCoincidence ()
 
bool moveMultiples ()
 
bool moveNearby ()
 
SkOpContournext ()
 
const SkOpContournext () const
 
bool operand () const
 
bool oppXor () const
 
void outdentDump () const
 
void rayCheck (const SkOpRayHit &base, SkOpRayDir dir, SkOpRayHit **hits, SkArenaAlloc *)
 
void reset ()
 
void resetReverse ()
 
bool reversed () const
 
void setBounds ()
 
void setCcw (int ccw)
 
void setGlobalState (SkOpGlobalState *state)
 
void setNext (SkOpContour *contour)
 
void setOperand (bool isOp)
 
void setOppXor (bool isOppXor)
 
void setReverse ()
 
void setXor (bool isXor)
 
bool sortAngles ()
 
const SkPointstart () const
 
void toPartialBackward (SkPathWriter *path) const
 
void toPartialForward (SkPathWriter *path) const
 
void toReversePath (SkPathWriter *path) const
 
void toPath (SkPathWriter *path) const
 
SkOpSpanundoneSpan ()
 

Protected Member Functions

 SkDEBUGCODE (int fID;) SkDEBUGCODE(mutable int fDebugIndent
 

Protected Attributes

SkOpGlobalStatefState
 
SkOpSegment fHead
 
SkOpSegmentfTail
 
SkOpContourfNext
 
SkPathOpsBounds fBounds
 
int fCcw
 
int fCount
 
int fFirstSorted
 
bool fDone
 
bool fOperand
 
bool fReverse
 
bool fXor
 
bool fOppXor
 

Detailed Description

Definition at line 28 of file SkOpContour.h.

Constructor & Destructor Documentation

◆ SkOpContour()

SkOpContour::SkOpContour ( )
inline

Definition at line 30 of file SkOpContour.h.

30 {
31 reset();
32 }

Member Function Documentation

◆ addConic()

void SkOpContour::addConic ( SkPoint  pts[3],
SkScalar  weight 
)
inline

Definition at line 40 of file SkOpContour.h.

40 {
41 appendSegment().addConic(pts, weight, this);
42 }
SkOpSegment & appendSegment()
Definition SkOpContour.h:57
SkOpSegment * addConic(SkPoint pts[3], SkScalar weight, SkOpContour *parent)
Definition SkOpSegment.h:55

◆ addCubic()

void SkOpContour::addCubic ( SkPoint  pts[4])
inline

Definition at line 44 of file SkOpContour.h.

44 {
45 appendSegment().addCubic(pts, this);
46 }
SkOpSegment * addCubic(SkPoint pts[4], SkOpContour *parent)
Definition SkOpSegment.h:63

◆ addLine()

SkOpSegment * SkOpContour::addLine ( SkPoint  pts[2])
inline

Definition at line 48 of file SkOpContour.h.

48 {
49 SkASSERT(pts[0] != pts[1]);
50 return appendSegment().addLine(pts, this);
51 }
#define SkASSERT(cond)
Definition SkAssert.h:116
SkOpSegment * addLine(SkPoint pts[2], SkOpContour *parent)
Definition SkOpSegment.h:82

◆ addQuad()

void SkOpContour::addQuad ( SkPoint  pts[3])
inline

Definition at line 53 of file SkOpContour.h.

53 {
54 appendSegment().addQuad(pts, this);
55 }
SkOpSegment * addQuad(SkPoint pts[3], SkOpContour *parent)
Definition SkOpSegment.h:98

◆ appendSegment()

SkOpSegment & SkOpContour::appendSegment ( )
inline

Definition at line 57 of file SkOpContour.h.

57 {
59 : &fHead;
61 if (fTail) {
63 }
64 fTail = result;
65 return *result;
66 }
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkOpGlobalState * globalState() const
SkOpSegment * fTail
SkOpSegment fHead
SkArenaAlloc * allocator()
void setPrev(SkOpSegment *prev)
void setNext(SkOpSegment *next)
GAsyncResult * result

◆ bounds()

const SkPathOpsBounds & SkOpContour::bounds ( ) const
inline

Definition at line 68 of file SkOpContour.h.

68 {
69 return fBounds;
70 }
SkPathOpsBounds fBounds

◆ calcAngles()

void SkOpContour::calcAngles ( )
inline

Definition at line 72 of file SkOpContour.h.

72 {
73 SkASSERT(fCount > 0);
74 SkOpSegment* segment = &fHead;
75 do {
76 segment->calcAngles();
77 } while ((segment = segment->next()));
78 }
void calcAngles()
SkOpSegment * next() const

◆ complete()

void SkOpContour::complete ( )
inline

Definition at line 80 of file SkOpContour.h.

80 {
81 setBounds();
82 }
void setBounds()

◆ count()

int SkOpContour::count ( ) const
inline

Definition at line 84 of file SkOpContour.h.

84 {
85 return fCount;
86 }

◆ debugAngle()

const SkOpAngle * SkOpContour::debugAngle ( int  id) const
inline

Definition at line 96 of file SkOpContour.h.

96 {
97 return SkDEBUGRELEASE(this->globalState()->debugAngle(id), nullptr);
98 }
#define SkDEBUGRELEASE(a, b)
const SkOpAngle * debugAngle(int id) const
Definition SkOpContour.h:96

◆ debugCoincidence()

const SkOpCoincidence * SkOpContour::debugCoincidence ( ) const
inline

Definition at line 100 of file SkOpContour.h.

100 {
101 return this->globalState()->coincidence();
102 }
SkOpCoincidence * coincidence()

◆ debugContour()

SkOpContour * SkOpContour::debugContour ( int  id) const
inline

Definition at line 108 of file SkOpContour.h.

108 {
109 return SkDEBUGRELEASE(this->globalState()->debugContour(id), nullptr);
110 }
SkOpContour * debugContour(int id) const

◆ debugID()

int SkOpContour::debugID ( ) const
inline

Definition at line 88 of file SkOpContour.h.

88 {
89 return SkDEBUGRELEASE(fID, -1);
90 }

◆ debugIndent()

int SkOpContour::debugIndent ( ) const
inline

Definition at line 92 of file SkOpContour.h.

92 {
93 return SkDEBUGRELEASE(fDebugIndent, 0);
94 }

◆ debugPtT()

const SkOpPtT * SkOpContour::debugPtT ( int  id) const
inline

Definition at line 118 of file SkOpContour.h.

118 {
119 return SkDEBUGRELEASE(this->globalState()->debugPtT(id), nullptr);
120 }
const SkOpPtT * debugPtT(int id) const

◆ debugSegment()

const SkOpSegment * SkOpContour::debugSegment ( int  id) const
inline

Definition at line 122 of file SkOpContour.h.

122 {
123 return SkDEBUGRELEASE(this->globalState()->debugSegment(id), nullptr);
124 }
const SkOpSegment * debugSegment(int id) const

◆ debugSpan()

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

Definition at line 135 of file SkOpContour.h.

135 {
136 return SkDEBUGRELEASE(this->globalState()->debugSpan(id), nullptr);
137 }
const SkOpSpanBase * debugSpan(int id) const

◆ debugValidate()

void SkOpContour::debugValidate ( ) const
inline

Definition at line 143 of file SkOpContour.h.

143 {
144#if DEBUG_VALIDATE
145 const SkOpSegment* segment = &fHead;
146 const SkOpSegment* prior = nullptr;
147 do {
148 segment->debugValidate();
149 SkASSERT(segment->prev() == prior);
150 prior = segment;
151 } while ((segment = segment->next()));
152 SkASSERT(prior == fTail);
153#endif
154 }
void debugValidate() const
const SkOpSegment * prev() const

◆ done()

bool SkOpContour::done ( ) const
inline

Definition at line 156 of file SkOpContour.h.

156 {
157 return fDone;
158 }

◆ dump()

void SkOpContour::dump ( ) const

Definition at line 978 of file PathOpsDebug.cpp.

978 {
979 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor);
980 if (!fCount) {
981 return;
982 }
983 const SkOpSegment* segment = &fHead;
984 SkDEBUGCODE(fDebugIndent = 0);
985 this->indentDump();
986 do {
987 segment->dump();
988 } while ((segment = segment->next()));
989 this->outdentDump();
990}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
void indentDump() const
void outdentDump() const
int debugID() const
Definition SkOpContour.h:88
void dump() const

◆ dumpAll()

void SkOpContour::dumpAll ( ) const

Definition at line 992 of file PathOpsDebug.cpp.

992 {
993 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor);
994 if (!fCount) {
995 return;
996 }
997 const SkOpSegment* segment = &fHead;
998 SkDEBUGCODE(fDebugIndent = 0);
999 this->indentDump();
1000 do {
1001 segment->dumpAll();
1002 } while ((segment = segment->next()));
1003 this->outdentDump();
1004}
void dumpAll() const

◆ dumpAngles()

void SkOpContour::dumpAngles ( ) const

Definition at line 1007 of file PathOpsDebug.cpp.

1007 {
1008 SkDebugf("contour=%d\n", this->debugID());
1009 const SkOpSegment* segment = &fHead;
1010 do {
1011 SkDebugf(" seg=%d ", segment->debugID());
1012 segment->dumpAngles();
1013 } while ((segment = segment->next()));
1014}
void dumpAngles() const
int debugID() const

◆ dumpContours()

void SkOpContour::dumpContours ( ) const

Definition at line 380 of file PathOpsDebug.cpp.

380 {
382 do {
383 contour->dump();
384 } while ((contour = contour->next()));
385}
void dump() const
SkOpContourHead * contourHead()

◆ dumpContoursAll()

void SkOpContour::dumpContoursAll ( ) const

Definition at line 387 of file PathOpsDebug.cpp.

387 {
389 do {
390 contour->dumpAll();
391 } while ((contour = contour->next()));
392}
void dumpAll() const

◆ dumpContoursAngles()

void SkOpContour::dumpContoursAngles ( ) const

Definition at line 394 of file PathOpsDebug.cpp.

394 {
396 do {
397 contour->dumpAngles();
398 } while ((contour = contour->next()));
399}
void dumpAngles() const

◆ dumpContoursPt()

void SkOpContour::dumpContoursPt ( int  segmentID) const

Definition at line 408 of file PathOpsDebug.cpp.

408 {
410 do {
411 contour->dumpPt(segmentID);
412 } while ((contour = contour->next()));
413}
void dumpPt(int) const

◆ dumpContoursPts()

void SkOpContour::dumpContoursPts ( ) const

Definition at line 401 of file PathOpsDebug.cpp.

401 {
403 do {
404 contour->dumpPts();
405 } while ((contour = contour->next()));
406}
void dumpPts(const char *prefix="seg") const

◆ dumpContoursSegment()

void SkOpContour::dumpContoursSegment ( int  segmentID) const

Definition at line 415 of file PathOpsDebug.cpp.

415 {
417 do {
418 contour->dumpSegment(segmentID);
419 } while ((contour = contour->next()));
420}
void dumpSegment(int) const

◆ dumpContoursSpan()

void SkOpContour::dumpContoursSpan ( int  segmentID) const

Definition at line 422 of file PathOpsDebug.cpp.

422 {
424 do {
425 contour->dumpSpan(spanID);
426 } while ((contour = contour->next()));
427}
void dumpSpan(int) const

◆ dumpContoursSpans()

void SkOpContour::dumpContoursSpans ( ) const

Definition at line 429 of file PathOpsDebug.cpp.

429 {
431 do {
432 contour->dumpSpans();
433 } while ((contour = contour->next()));
434}
void dumpSpans() const

◆ dumpPt()

void SkOpContour::dumpPt ( int  index) const

Definition at line 1016 of file PathOpsDebug.cpp.

1016 {
1017 const SkOpSegment* segment = &fHead;
1018 do {
1019 if (segment->debugID() == index) {
1020 segment->dumpPts();
1021 }
1022 } while ((segment = segment->next()));
1023}
void dumpPts(const char *prefix="seg") const

◆ dumpPts()

void SkOpContour::dumpPts ( const char *  prefix = "seg") const

Definition at line 1025 of file PathOpsDebug.cpp.

1025 {
1026 SkDebugf("contour=%d\n", this->debugID());
1027 const SkOpSegment* segment = &fHead;
1028 do {
1029 SkDebugf(" %s=%d ", prefix, segment->debugID());
1030 segment->dumpPts(prefix);
1031 } while ((segment = segment->next()));
1032}

◆ dumpPtsX()

void SkOpContour::dumpPtsX ( const char *  prefix) const

Definition at line 1034 of file PathOpsDebug.cpp.

1034 {
1035 if (!this->fCount) {
1036 SkDebugf("<empty>\n");
1037 return;
1038 }
1039 const SkOpSegment* segment = &fHead;
1040 do {
1041 segment->dumpPts(prefix);
1042 } while ((segment = segment->next()));
1043}

◆ dumpSegment()

void SkOpContour::dumpSegment ( int  index) const

Definition at line 1045 of file PathOpsDebug.cpp.

1045 {
1046 debugSegment(index)->dump();
1047}

◆ dumpSegments()

void SkOpContour::dumpSegments ( const char *  prefix = "seg",
SkPathOp  op = (SkPathOp) -1 
) const

Definition at line 1049 of file PathOpsDebug.cpp.

1049 {
1050 bool firstOp = false;
1051 const SkOpContour* c = this;
1052 do {
1053 if (!firstOp && c->operand()) {
1054#if DEBUG_ACTIVE_OP
1055 SkDebugf("op %s\n", SkPathOpsDebug::kPathOpStr[op]);
1056#endif
1057 firstOp = true;
1058 }
1059 c->dumpPtsX(prefix);
1060 } while ((c = c->next()));
1061}
bool operand() const
SkOpContour * next()
void dumpPtsX(const char *prefix) const

◆ dumpSpan()

void SkOpContour::dumpSpan ( int  index) const

Definition at line 1063 of file PathOpsDebug.cpp.

1063 {
1064 debugSpan(index)->dump();
1065}
void dump() const

◆ dumpSpans()

void SkOpContour::dumpSpans ( ) const

Definition at line 1067 of file PathOpsDebug.cpp.

1067 {
1068 SkDebugf("contour=%d\n", this->debugID());
1069 const SkOpSegment* segment = &fHead;
1070 do {
1071 SkDebugf(" seg=%d ", segment->debugID());
1072 segment->dump();
1073 } while ((segment = segment->next()));
1074}

◆ end()

const SkPoint & SkOpContour::end ( ) const
inline

Definition at line 179 of file SkOpContour.h.

179 {
181 }
int SkPathOpsVerbToPoints(SkPath::Verb verb)
SkPath::Verb verb() const
const SkPoint * pts() const

◆ findSortableTop()

SkOpSpan * SkOpContour::findSortableTop ( SkOpContour contourHead)

Definition at line 408 of file SkPathOpsWinding.cpp.

408 {
409 bool allDone = true;
410 if (fCount) {
411 SkOpSegment* testSegment = &fHead;
412 do {
413 if (testSegment->done()) {
414 continue;
415 }
416 allDone = false;
417 SkOpSpan* result = testSegment->findSortableTop(contourHead);
418 if (result) {
419 return result;
420 }
421 } while ((testSegment = testSegment->next()));
422 }
423 if (allDone) {
424 fDone = true;
425 }
426 return nullptr;
427}
SkOpSpan * findSortableTop(SkOpContour *)
bool done() const

◆ first() [1/2]

SkOpSegment * SkOpContour::first ( )
inline

Definition at line 185 of file SkOpContour.h.

185 {
186 SkASSERT(fCount > 0);
187 return &fHead;
188 }

◆ first() [2/2]

const SkOpSegment * SkOpContour::first ( ) const
inline

Definition at line 190 of file SkOpContour.h.

190 {
191 SkASSERT(fCount > 0);
192 return &fHead;
193 }

◆ globalState()

SkOpGlobalState * SkOpContour::globalState ( ) const
inline

Definition at line 139 of file SkOpContour.h.

139 {
140 return fState;
141 }
SkOpGlobalState * fState

◆ indentDump()

void SkOpContour::indentDump ( ) const
inline

Definition at line 195 of file SkOpContour.h.

195 {
196 SkDEBUGCODE(fDebugIndent += 2);
197 }

◆ init()

void SkOpContour::init ( SkOpGlobalState globalState,
bool  operand,
bool  isXor 
)
inline

Definition at line 199 of file SkOpContour.h.

199 {
202 fXor = isXor;
203 SkDEBUGCODE(fID = globalState->nextContourID());
204 }
bool isXor() const

◆ isCcw()

int SkOpContour::isCcw ( ) const
inline

Definition at line 206 of file SkOpContour.h.

206 {
207 return fCcw;
208 }

◆ isXor()

bool SkOpContour::isXor ( ) const
inline

Definition at line 210 of file SkOpContour.h.

210 {
211 return fXor;
212 }

◆ joinSegments()

void SkOpContour::joinSegments ( )
inline

Definition at line 214 of file SkOpContour.h.

214 {
215 SkOpSegment* segment = &fHead;
217 do {
218 next = segment->next();
219 segment->joinEnds(next ? next : &fHead);
220 } while ((segment = next));
221 }
void joinEnds(SkOpSegment *start)

◆ markAllDone()

void SkOpContour::markAllDone ( )
inline

Definition at line 223 of file SkOpContour.h.

223 {
224 SkOpSegment* segment = &fHead;
225 do {
226 segment->markAllDone();
227 } while ((segment = segment->next()));
228 }
void markAllDone()

◆ missingCoincidence()

bool SkOpContour::missingCoincidence ( )
inline

Definition at line 231 of file SkOpContour.h.

231 {
232 SkASSERT(fCount > 0);
233 SkOpSegment* segment = &fHead;
234 bool result = false;
235 do {
236 if (segment->missingCoincidence()) {
237 result = true;
238 }
239 segment = segment->next();
240 } while (segment);
241 return result;
242 }
bool missingCoincidence()

◆ moveMultiples()

bool SkOpContour::moveMultiples ( )
inline

Definition at line 244 of file SkOpContour.h.

244 {
245 SkASSERT(fCount > 0);
246 SkOpSegment* segment = &fHead;
247 do {
248 if (!segment->moveMultiples()) {
249 return false;
250 }
251 } while ((segment = segment->next()));
252 return true;
253 }
bool moveMultiples()

◆ moveNearby()

bool SkOpContour::moveNearby ( )
inline

Definition at line 255 of file SkOpContour.h.

255 {
256 SkASSERT(fCount > 0);
257 SkOpSegment* segment = &fHead;
258 do {
259 if (!segment->moveNearby()) {
260 return false;
261 }
262 } while ((segment = segment->next()));
263 return true;
264 }

◆ next() [1/2]

SkOpContour * SkOpContour::next ( )
inline

Definition at line 266 of file SkOpContour.h.

266 {
267 return fNext;
268 }
SkOpContour * fNext

◆ next() [2/2]

const SkOpContour * SkOpContour::next ( ) const
inline

Definition at line 270 of file SkOpContour.h.

270 {
271 return fNext;
272 }

◆ operand()

bool SkOpContour::operand ( ) const
inline

Definition at line 274 of file SkOpContour.h.

274 {
275 return fOperand;
276 }

◆ operator<()

bool SkOpContour::operator< ( const SkOpContour rh) const
inline

Definition at line 34 of file SkOpContour.h.

34 {
35 return fBounds.fTop == rh.fBounds.fTop
37 : fBounds.fTop < rh.fBounds.fTop;
38 }
SkScalar fLeft
smaller x-axis bounds
Definition extension.cpp:14
SkScalar fTop
smaller y-axis bounds
Definition extension.cpp:15

◆ oppXor()

bool SkOpContour::oppXor ( ) const
inline

Definition at line 278 of file SkOpContour.h.

278 {
279 return fOppXor;
280 }

◆ outdentDump()

void SkOpContour::outdentDump ( ) const
inline

Definition at line 282 of file SkOpContour.h.

282 {
283 SkDEBUGCODE(fDebugIndent -= 2);
284 }

◆ rayCheck()

void SkOpContour::rayCheck ( const SkOpRayHit base,
SkOpRayDir  dir,
SkOpRayHit **  hits,
SkArenaAlloc allocator 
)

Definition at line 123 of file SkPathOpsWinding.cpp.

124 {
125 // if the bounds extreme is outside the best, we're done
126 SkScalar baseXY = pt_xy(base.fPt, dir);
127 SkScalar boundsXY = rect_side(fBounds, dir);
128 bool checkLessThan = less_than(dir);
129 if (!approximately_equal(baseXY, boundsXY) && (baseXY < boundsXY) == checkLessThan) {
130 return;
131 }
132 SkOpSegment* testSegment = &fHead;
133 do {
134 testSegment->rayCheck(base, dir, hits, allocator);
135 } while ((testSegment = testSegment->next()));
136}
bool approximately_equal(double x, double y)
static bool less_than(SkOpRayDir dir)
static SkScalar pt_xy(const SkPoint &pt, SkOpRayDir dir)
static SkScalar rect_side(const SkRect &r, SkOpRayDir dir)
void rayCheck(const SkOpRayHit &base, SkOpRayDir dir, SkOpRayHit **hits, SkArenaAlloc *)
float SkScalar
Definition extension.cpp:12

◆ reset()

void SkOpContour::reset ( )
inline

Definition at line 288 of file SkOpContour.h.

288 {
289 fTail = nullptr;
290 fNext = nullptr;
291 fCount = 0;
292 fDone = false;
295 SkDEBUGCODE(fDebugIndent = 0);
296 }
#define SK_ScalarMin
Definition SkScalar.h:25
#define SK_ScalarMax
Definition SkScalar.h:24
void setLTRB(float left, float top, float right, float bottom)
Definition SkRect.h:865

◆ resetReverse()

void SkOpContour::resetReverse ( )
inline

Definition at line 298 of file SkOpContour.h.

298 {
299 SkOpContour* next = this;
300 do {
301 if (!next->count()) {
302 continue;
303 }
304 next->fCcw = -1;
305 next->fReverse = false;
306 } while ((next = next->next()));
307 }
int count() const
Definition SkOpContour.h:84

◆ reversed()

bool SkOpContour::reversed ( ) const
inline

Definition at line 309 of file SkOpContour.h.

309 {
310 return fReverse;
311 }

◆ setBounds()

void SkOpContour::setBounds ( )
inline

Definition at line 313 of file SkOpContour.h.

313 {
314 SkASSERT(fCount > 0);
315 const SkOpSegment* segment = &fHead;
316 fBounds = segment->bounds();
317 while ((segment = segment->next())) {
318 fBounds.add(segment->bounds());
319 }
320 }
const SkPathOpsBounds & bounds() const
void add(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)

◆ setCcw()

void SkOpContour::setCcw ( int  ccw)
inline

Definition at line 322 of file SkOpContour.h.

322 {
323 fCcw = ccw;
324 }

◆ setGlobalState()

void SkOpContour::setGlobalState ( SkOpGlobalState state)
inline

Definition at line 326 of file SkOpContour.h.

326 {
327 fState = state;
328 }
AtkStateType state

◆ setNext()

void SkOpContour::setNext ( SkOpContour contour)
inline

Definition at line 330 of file SkOpContour.h.

330 {
331// SkASSERT(!fNext == !!contour);
332 fNext = contour;
333 }

◆ setOperand()

void SkOpContour::setOperand ( bool  isOp)
inline

Definition at line 335 of file SkOpContour.h.

335 {
336 fOperand = isOp;
337 }

◆ setOppXor()

void SkOpContour::setOppXor ( bool  isOppXor)
inline

Definition at line 339 of file SkOpContour.h.

339 {
340 fOppXor = isOppXor;
341 }

◆ setReverse()

void SkOpContour::setReverse ( )
inline

Definition at line 343 of file SkOpContour.h.

343 {
344 fReverse = true;
345 }

◆ setXor()

void SkOpContour::setXor ( bool  isXor)
inline

Definition at line 347 of file SkOpContour.h.

347 {
348 fXor = isXor;
349 }

◆ SkDEBUGCODE()

SkOpContour::SkDEBUGCODE ( int fID;  )
protected

◆ sortAngles()

bool SkOpContour::sortAngles ( )
inline

Definition at line 351 of file SkOpContour.h.

351 {
352 SkASSERT(fCount > 0);
353 SkOpSegment* segment = &fHead;
354 do {
355 FAIL_IF(!segment->sortAngles());
356 } while ((segment = segment->next()));
357 return true;
358 }
#define FAIL_IF(cond)

◆ start()

const SkPoint & SkOpContour::start ( ) const
inline

Definition at line 360 of file SkOpContour.h.

360 {
361 return fHead.pts()[0];
362 }

◆ toPartialBackward()

void SkOpContour::toPartialBackward ( SkPathWriter path) const
inline

Definition at line 364 of file SkOpContour.h.

364 {
365 const SkOpSegment* segment = fTail;
366 do {
367 SkAssertResult(segment->addCurveTo(segment->tail(), segment->head(), path));
368 } while ((segment = segment->prev()));
369 }
#define SkAssertResult(cond)
Definition SkAssert.h:123
const SkOpSpanBase * tail() const
const SkOpSpan * head() const
bool addCurveTo(const SkOpSpanBase *start, const SkOpSpanBase *end, SkPathWriter *path) const

◆ toPartialForward()

void SkOpContour::toPartialForward ( SkPathWriter path) const
inline

Definition at line 371 of file SkOpContour.h.

371 {
372 const SkOpSegment* segment = &fHead;
373 do {
374 SkAssertResult(segment->addCurveTo(segment->head(), segment->tail(), path));
375 } while ((segment = segment->next()));
376 }

◆ toPath()

void SkOpContour::toPath ( SkPathWriter path) const

Definition at line 13 of file SkOpContour.cpp.

13 {
14 if (!this->count()) {
15 return;
16 }
17 const SkOpSegment* segment = &fHead;
18 do {
19 SkAssertResult(segment->addCurveTo(segment->head(), segment->tail(), path));
20 } while ((segment = segment->next()));
21 path->finishContour();
22 path->assemble();
23}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ toReversePath()

void SkOpContour::toReversePath ( SkPathWriter path) const

Definition at line 25 of file SkOpContour.cpp.

25 {
26 const SkOpSegment* segment = fTail;
27 do {
28 SkAssertResult(segment->addCurveTo(segment->tail(), segment->head(), path));
29 } while ((segment = segment->prev()));
30 path->finishContour();
31 path->assemble();
32}

◆ undoneSpan()

SkOpSpan * SkOpContour::undoneSpan ( )

Definition at line 34 of file SkOpContour.cpp.

34 {
35 SkOpSegment* testSegment = &fHead;
36 do {
37 if (testSegment->done()) {
38 continue;
39 }
40 return testSegment->undoneSpan();
41 } while ((testSegment = testSegment->next()));
42 fDone = true;
43 return nullptr;
44}
SkOpSpan * undoneSpan()

Member Data Documentation

◆ fBounds

SkPathOpsBounds SkOpContour::fBounds
protected

Definition at line 387 of file SkOpContour.h.

◆ fCcw

int SkOpContour::fCcw
protected

Definition at line 388 of file SkOpContour.h.

◆ fCount

int SkOpContour::fCount
protected

Definition at line 389 of file SkOpContour.h.

◆ fDone

bool SkOpContour::fDone
protected

Definition at line 391 of file SkOpContour.h.

◆ fFirstSorted

int SkOpContour::fFirstSorted
protected

Definition at line 390 of file SkOpContour.h.

◆ fHead

SkOpSegment SkOpContour::fHead
protected

Definition at line 384 of file SkOpContour.h.

◆ fNext

SkOpContour* SkOpContour::fNext
protected

Definition at line 386 of file SkOpContour.h.

◆ fOperand

bool SkOpContour::fOperand
protected

Definition at line 392 of file SkOpContour.h.

◆ fOppXor

bool SkOpContour::fOppXor
protected

Definition at line 395 of file SkOpContour.h.

◆ fReverse

bool SkOpContour::fReverse
protected

Definition at line 393 of file SkOpContour.h.

◆ fState

SkOpGlobalState* SkOpContour::fState
protected

Definition at line 383 of file SkOpContour.h.

◆ fTail

SkOpSegment* SkOpContour::fTail
protected

Definition at line 385 of file SkOpContour.h.

◆ fXor

bool SkOpContour::fXor
protected

Definition at line 394 of file SkOpContour.h.


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