8#ifndef skgpu_tessellate_MiddleOutPolygonTriangulator_DEFINED
9#define skgpu_tessellate_MiddleOutPolygonTriangulator_DEFINED
83 StackVertex* newTopVertex,
84 StackVertex newTopValue)
85 : fMiddleOut(middleOut)
86 , fLastPoint(lastPoint)
88 , fNewTopVertex(newTopVertex)
89 , fNewTopValue(newTopValue) {
93 memcpy(
this, &that,
sizeof(*
this));
94 that.fMiddleOut =
nullptr;
99 fMiddleOut->fTop = fNewTopVertex;
100 *fNewTopVertex = fNewTopValue;
114 Iter begin()
const {
return {fMiddleOut ? fMiddleOut->fTop : fEnd, fLastPoint}; }
115 Iter end()
const {
return {fEnd, fLastPoint}; }
121 StackVertex* fNewTopVertex;
122 StackVertex fNewTopValue;
130 int maxStackDepth =
SkNextLog2(maxPushVertexCalls) + 1;
131 if (maxStackDepth > kStackPreallocCount) {
132 fVertexStack.
reset(maxStackDepth);
134 SkDEBUGCODE(fStackAllocCount = maxStackDepth;)
137 fVertexStack[0] = {startPoint, 0};
153 StackVertex* endVertex = fTop;
154 int vertexIdxDelta = 1;
155 while (endVertex->fVertexIdxDelta == vertexIdxDelta) {
161 StackVertex* newTopVertex = endVertex + 1;
162 StackVertex newTopValue = {pt, vertexIdxDelta};
163 SkASSERT(newTopVertex < fVertexStack + fStackAllocCount);
172 SkPoint startPt = fVertexStack[0].fPoint;
176 StackVertex* endVertex =
std::min(fTop, fVertexStack + 1);
179 StackVertex* newTopVertex = fVertexStack;
180 StackVertex newTopValue = {newStartPoint, 0};
192 constexpr static int kStackPreallocCount = 32;
194 SkDEBUGCODE(
int fStackAllocCount;)
211 fPathIter = it.
begin();
215 bool done()
const {
return fDone; }
219 if (fPathIter == fPathEnd) {
221 return fMiddleOut.
close();
223 switch (
auto [verb, pts,
w] = *fPathIter++; verb) {
234 return fMiddleOut.
close();
static int SkNextLog2(uint32_t value)
@ 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.
static int PtsInIter(unsigned verb)
SkPath::RangeIter RangeIter
PoppedTriangleStack(PoppedTriangleStack &&that)
PoppedTriangleStack(MiddleOutPolygonTriangulator *middleOut, SkPoint lastPoint, StackVertex *end, StackVertex *newTopVertex, StackVertex newTopValue)
MiddleOutPolygonTriangulator(int maxPushVertexCalls, SkPoint startPoint={0, 0})
PoppedTriangleStack pushVertex(SkPoint pt)
PoppedTriangleStack close()
PoppedTriangleStack closeAndMove(SkPoint newStartPoint)
MiddleOutPolygonTriangulator::PoppedTriangleStack nextStack()
PathMiddleOutFanIter(const SkPath &path)
static float min(float r, float g, float b)
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
SkPath::RangeIter begin()
bool operator!=(const Iter &iter)
std::tuple< SkPoint, SkPoint, SkPoint > operator*()