Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
ContourIter Class Reference

Public Member Functions

 ContourIter (const SkPathRef &pathRef)
 
bool done () const
 
int count () const
 
const SkPointpts () const
 
void next ()
 

Detailed Description

Definition at line 2461 of file SkPath.cpp.

Constructor & Destructor Documentation

◆ ContourIter()

ContourIter::ContourIter ( const SkPathRef pathRef)

Definition at line 2481 of file SkPath.cpp.

2481 {
2482 fStopVerbs = pathRef.verbsEnd();
2483 fDone = false;
2484 fCurrPt = pathRef.points();
2485 fCurrVerb = pathRef.verbsBegin();
2486 fCurrConicWeight = pathRef.conicWeights();
2487 fCurrPtCount = 0;
2488 SkDEBUGCODE(fContourCounter = 0;)
2489 this->next();
2490}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void next()
Definition: SkPath.cpp:2492
const uint8_t * verbsEnd() const
Definition: SkPathRef.h:321
const SkPoint * points() const
Definition: SkPathRef.h:326
const SkScalar * conicWeights() const
Definition: SkPathRef.h:333
const uint8_t * verbsBegin() const
Definition: SkPathRef.h:316

Member Function Documentation

◆ count()

int ContourIter::count ( ) const
inline

Definition at line 2467 of file SkPath.cpp.

2467{ return fCurrPtCount; }

◆ done()

bool ContourIter::done ( ) const
inline

Definition at line 2465 of file SkPath.cpp.

2465{ return fDone; }

◆ next()

void ContourIter::next ( )

Definition at line 2492 of file SkPath.cpp.

2492 {
2493 if (fCurrVerb >= fStopVerbs) {
2494 fDone = true;
2495 }
2496 if (fDone) {
2497 return;
2498 }
2499
2500 // skip pts of prev contour
2501 fCurrPt += fCurrPtCount;
2502
2503 SkASSERT(SkPath::kMove_Verb == fCurrVerb[0]);
2504 int ptCount = 1; // moveTo
2505 const uint8_t* verbs = fCurrVerb;
2506
2507 for (verbs++; verbs < fStopVerbs; verbs++) {
2508 switch (*verbs) {
2509 case SkPath::kMove_Verb:
2510 goto CONTOUR_END;
2511 case SkPath::kLine_Verb:
2512 ptCount += 1;
2513 break;
2515 fCurrConicWeight += 1;
2516 [[fallthrough]];
2517 case SkPath::kQuad_Verb:
2518 ptCount += 2;
2519 break;
2521 ptCount += 3;
2522 break;
2524 break;
2525 default:
2526 SkDEBUGFAIL("unexpected verb");
2527 break;
2528 }
2529 }
2530CONTOUR_END:
2531 fCurrPtCount = ptCount;
2532 fCurrVerb = verbs;
2533 SkDEBUGCODE(++fContourCounter;)
2534}
#define SkDEBUGFAIL(message)
Definition: SkAssert.h:118
#define SkASSERT(cond)
Definition: SkAssert.h:116
@ kClose_Verb
Definition: SkPath.h:1471
@ kMove_Verb
Definition: SkPath.h:1466
@ kConic_Verb
Definition: SkPath.h:1469
@ kCubic_Verb
Definition: SkPath.h:1470
@ kQuad_Verb
Definition: SkPath.h:1468
@ kLine_Verb
Definition: SkPath.h:1467

◆ pts()

const SkPoint * ContourIter::pts ( ) const
inline

Definition at line 2468 of file SkPath.cpp.

2468{ return fCurrPt; }

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