#include <MidpointContourParser.h>
Definition at line 29 of file MidpointContourParser.h.
◆ MidpointContourParser()
skgpu::tess::MidpointContourParser::MidpointContourParser |
( |
const SkPath & |
path | ) |
|
|
inline |
Definition at line 31 of file MidpointContourParser.h.
32 : fPath(path)
static const uint8_t * VerbData(const SkPath &path)
static const SkScalar * ConicWeightData(const SkPath &path)
static const SkPoint * PointData(const SkPath &path)
◆ currentContour()
◆ currentMidpoint()
SkPoint skgpu::tess::MidpointContourParser::currentMidpoint |
( |
| ) |
|
|
inline |
◆ parseNextContour()
bool skgpu::tess::MidpointContourParser::parseNextContour |
( |
| ) |
|
|
inline |
Definition at line 39 of file MidpointContourParser.h.
39 {
40 bool hasGeometry = false;
41 for (; fVerbsIdx < fNumRemainingVerbs; ++fVerbsIdx) {
42 switch (fVerbs[fVerbsIdx]) {
44 if (!hasGeometry) {
45 fMidpoint = {0,0};
46 fMidpointWeight = 0;
47 this->advance();
48 fPtsIdx = 1;
49 continue;
50 }
51 if (fPoints[0] != fPoints[fPtsIdx - 1]) {
52
53 fMidpoint += fPoints[0];
54 ++fMidpointWeight;
55 }
56 return true;
57 default:
58 continue;
60 ++fPtsIdx;
61 break;
63 ++fWtsIdx;
64 [[fallthrough]];
66 fPtsIdx += 2;
67 break;
69 fPtsIdx += 3;
70 break;
71 }
72 fMidpoint += fPoints[fPtsIdx - 1];
73 ++fMidpointWeight;
74 hasGeometry = true;
75 }
76 if (hasGeometry && fPoints[0] != fPoints[fPtsIdx - 1]) {
77
78 fMidpoint += fPoints[0];
79 ++fMidpointWeight;
80 }
81 return hasGeometry;
82 }
The documentation for this class was generated from the following file: