Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
SkPath::RawIter Class Reference

#include <SkPath.h>

Public Member Functions

 RawIter ()
 
 RawIter (const SkPath &path)
 
void setPath (const SkPath &)
 
Verb next (SkPoint[4])
 
Verb peek () const
 
SkScalar conicWeight () const
 

Friends

class SkPath
 

Detailed Description

Use Iter instead. This class will soon be removed and RangeIter will be made private.

Definition at line 1650 of file SkPath.h.

Constructor & Destructor Documentation

◆ RawIter() [1/2]

SkPath::RawIter::RawIter ( )
inline

Initializes RawIter with an empty SkPath. next() on RawIter returns kDone_Verb. Call setPath to initialize SkPath::Iter at a later time.

Returns
RawIter of empty SkPath

Definition at line 1658 of file SkPath.h.

1658{}

◆ RawIter() [2/2]

SkPath::RawIter::RawIter ( const SkPath path)
inline

Sets RawIter to return elements of verb array, SkPoint array, and conic weight in path.

Parameters
pathSkPath to iterate
Returns
RawIter of path

Definition at line 1665 of file SkPath.h.

1665 {
1666 setPath(path);
1667 }
void setPath(const SkPath &)
Definition: SkPath.cpp:1975
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

Member Function Documentation

◆ conicWeight()

SkScalar SkPath::RawIter::conicWeight ( ) const
inline

Returns conic weight if next() returned kConic_Verb.

If next() has not been called, or next() did not return kConic_Verb, result is undefined.

Returns
conic weight for conic SkPoint returned by next()

Definition at line 1700 of file SkPath.h.

1700 {
1701 return fConicWeight;
1702 }

◆ next()

SkPath::Verb SkPath::RawIter::next ( SkPoint  pts[4])

Returns next SkPath::Verb in verb array, and advances RawIter. When verb array is exhausted, returns kDone_Verb. Zero to four SkPoint are stored in pts, depending on the returned SkPath::Verb.

Parameters
ptsstorage for SkPoint data describing returned SkPath::Verb
Returns
next SkPath::Verb from verb array

Definition at line 1981 of file SkPath.cpp.

1981 {
1982 if (!(fIter != fEnd)) {
1983 return kDone_Verb;
1984 }
1985 auto [verb, iterPts, weights] = *fIter;
1986 int numPts;
1987 switch (verb) {
1988 case SkPathVerb::kMove: numPts = 1; break;
1989 case SkPathVerb::kLine: numPts = 2; break;
1990 case SkPathVerb::kQuad: numPts = 3; break;
1991 case SkPathVerb::kConic:
1992 numPts = 3;
1993 fConicWeight = *weights;
1994 break;
1995 case SkPathVerb::kCubic: numPts = 4; break;
1996 case SkPathVerb::kClose: numPts = 0; break;
1997 }
1998 memcpy(pts, iterPts, sizeof(SkPoint) * numPts);
1999 ++fIter;
2000 return (Verb) verb;
2001}
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
@ kDone_Verb
Definition: SkPath.h:1472

◆ peek()

Verb SkPath::RawIter::peek ( ) const
inline

Returns next SkPath::Verb, but does not advance RawIter.

Returns
next SkPath::Verb from verb array

Definition at line 1689 of file SkPath.h.

1689 {
1690 return (fIter != fEnd) ? static_cast<Verb>(std::get<0>(*fIter)) : kDone_Verb;
1691 }
const myers::Point & get< 0 >(const myers::Segment &s)
Definition: Myers.h:80

◆ setPath()

void SkPath::RawIter::setPath ( const SkPath path)

Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.

Parameters
pathSkPath to iterate

Definition at line 1975 of file SkPath.cpp.

1975 {
1976 SkPathPriv::Iterate iterate(path);
1977 fIter = iterate.begin();
1978 fEnd = iterate.end();
1979}

Friends And Related Function Documentation

◆ SkPath

friend class SkPath
friend

Definition at line 1708 of file SkPath.h.


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