Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 2397 of file SkPath.cpp.

Constructor & Destructor Documentation

◆ ContourIter()

ContourIter::ContourIter ( const SkPathRef pathRef)

Definition at line 2417 of file SkPath.cpp.

2417 {
2418 fStopVerbs = pathRef.verbsEnd();
2419 fDone = false;
2420 fCurrPt = pathRef.points();
2421 fCurrVerb = pathRef.verbsBegin();
2422 fCurrConicWeight = pathRef.conicWeights();
2423 fCurrPtCount = 0;
2424 SkDEBUGCODE(fContourCounter = 0;)
2425 this->next();
2426}
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
void next()
Definition SkPath.cpp:2428
const uint8_t * verbsEnd() const
Definition SkPathRef.h:323
const SkPoint * points() const
Definition SkPathRef.h:328
const SkScalar * conicWeights() const
Definition SkPathRef.h:335
const uint8_t * verbsBegin() const
Definition SkPathRef.h:318

Member Function Documentation

◆ count()

int ContourIter::count ( ) const
inline

Definition at line 2403 of file SkPath.cpp.

2403{ return fCurrPtCount; }

◆ done()

bool ContourIter::done ( ) const
inline

Definition at line 2401 of file SkPath.cpp.

2401{ return fDone; }

◆ next()

void ContourIter::next ( )

Definition at line 2428 of file SkPath.cpp.

2428 {
2429 if (fCurrVerb >= fStopVerbs) {
2430 fDone = true;
2431 }
2432 if (fDone) {
2433 return;
2434 }
2435
2436 // skip pts of prev contour
2437 fCurrPt += fCurrPtCount;
2438
2439 SkASSERT(SkPath::kMove_Verb == fCurrVerb[0]);
2440 int ptCount = 1; // moveTo
2441 const uint8_t* verbs = fCurrVerb;
2442
2443 for (verbs++; verbs < fStopVerbs; verbs++) {
2444 switch (*verbs) {
2445 case SkPath::kMove_Verb:
2446 goto CONTOUR_END;
2447 case SkPath::kLine_Verb:
2448 ptCount += 1;
2449 break;
2451 fCurrConicWeight += 1;
2452 [[fallthrough]];
2453 case SkPath::kQuad_Verb:
2454 ptCount += 2;
2455 break;
2457 ptCount += 3;
2458 break;
2460 break;
2461 default:
2462 SkDEBUGFAIL("unexpected verb");
2463 break;
2464 }
2465 }
2466CONTOUR_END:
2467 fCurrPtCount = ptCount;
2468 fCurrVerb = verbs;
2469 SkDEBUGCODE(++fContourCounter;)
2470}
#define SkDEBUGFAIL(message)
Definition SkAssert.h:118
#define SkASSERT(cond)
Definition SkAssert.h:116
@ kClose_Verb
Definition SkPath.h:1463
@ kMove_Verb
Definition SkPath.h:1458
@ kConic_Verb
Definition SkPath.h:1461
@ kCubic_Verb
Definition SkPath.h:1462
@ kQuad_Verb
Definition SkPath.h:1460
@ kLine_Verb
Definition SkPath.h:1459

◆ pts()

const SkPoint * ContourIter::pts ( ) const
inline

Definition at line 2404 of file SkPath.cpp.

2404{ return fCurrPt; }

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