Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkPathRef::Iter Class Reference

#include <SkPathRef.h>

Public Member Functions

 Iter ()
 
 Iter (const SkPathRef &)
 
void setPathRef (const SkPathRef &)
 
uint8_t next (SkPoint pts[4])
 
uint8_t peek () const
 
SkScalar conicWeight () const
 

Detailed Description

Definition at line 178 of file SkPathRef.h.

Constructor & Destructor Documentation

◆ Iter() [1/2]

SkPathRef::Iter::Iter ( )

Definition at line 533 of file SkPathRef.cpp.

533 {
534#ifdef SK_DEBUG
535 fPts = nullptr;
536 fConicWeights = nullptr;
537#endif
538 // need to init enough to make next() harmlessly return kDone_Verb
539 fVerbs = nullptr;
540 fVerbStop = nullptr;
541}

◆ Iter() [2/2]

SkPathRef::Iter::Iter ( const SkPathRef path)

Definition at line 543 of file SkPathRef.cpp.

543 {
544 this->setPathRef(path);
545}
void setPathRef(const SkPathRef &)

Member Function Documentation

◆ conicWeight()

SkScalar SkPathRef::Iter::conicWeight ( ) const
inline

Definition at line 197 of file SkPathRef.h.

197{ return *fConicWeights; }

◆ next()

uint8_t SkPathRef::Iter::next ( SkPoint  pts[4])

Return the next verb in this iteration of the path. When all segments have been visited, return kDone_Verb.

If any point in the path is non-finite, return kDone_Verb immediately.

Parameters
ptsThe points representing the current verb and/or segment This must not be NULL.
Returns
The verb for the current segment

Definition at line 562 of file SkPathRef.cpp.

562 {
563 SkASSERT(pts);
564
565 SkDEBUGCODE(unsigned peekResult = this->peek();)
566
567 if (fVerbs == fVerbStop) {
568 SkASSERT(peekResult == SkPath::kDone_Verb);
569 return (uint8_t) SkPath::kDone_Verb;
570 }
571
572 // fVerbs points one beyond next verb so decrement first.
573 unsigned verb = *fVerbs++;
574 const SkPoint* srcPts = fPts;
575
576 switch (verb) {
578 pts[0] = srcPts[0];
579 srcPts += 1;
580 break;
582 pts[0] = srcPts[-1];
583 pts[1] = srcPts[0];
584 srcPts += 1;
585 break;
587 fConicWeights += 1;
588 [[fallthrough]];
590 pts[0] = srcPts[-1];
591 pts[1] = srcPts[0];
592 pts[2] = srcPts[1];
593 srcPts += 2;
594 break;
596 pts[0] = srcPts[-1];
597 pts[1] = srcPts[0];
598 pts[2] = srcPts[1];
599 pts[3] = srcPts[2];
600 srcPts += 3;
601 break;
603 break;
605 SkASSERT(fVerbs == fVerbStop);
606 break;
607 }
608 fPts = srcPts;
609 SkASSERT(peekResult == verb);
610 return (uint8_t) verb;
611}
#define SkASSERT(cond)
Definition SkAssert.h:116
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
uint8_t peek() const
@ kClose_Verb
Definition SkPath.h:1463
@ kMove_Verb
Definition SkPath.h:1458
@ kConic_Verb
Definition SkPath.h:1461
@ kDone_Verb
Definition SkPath.h:1464
@ kCubic_Verb
Definition SkPath.h:1462
@ kQuad_Verb
Definition SkPath.h:1460
@ kLine_Verb
Definition SkPath.h:1459

◆ peek()

uint8_t SkPathRef::Iter::peek ( ) const

Definition at line 613 of file SkPathRef.cpp.

613 {
614 return fVerbs < fVerbStop ? *fVerbs : (uint8_t) SkPath::kDone_Verb;
615}

◆ setPathRef()

void SkPathRef::Iter::setPathRef ( const SkPathRef path)

Definition at line 547 of file SkPathRef.cpp.

547 {
548 fPts = path.points();
549 fVerbs = path.verbsBegin();
550 fVerbStop = path.verbsEnd();
551 fConicWeights = path.conicWeights();
552 if (fConicWeights) {
553 fConicWeights -= 1; // begin one behind
554 }
555
556 // Don't allow iteration through non-finite points.
557 if (!path.isFinite()) {
558 fVerbStop = fVerbs;
559 }
560}
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

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