#include <MiddleOutPolygonTriangulator.h>
◆ MiddleOutPolygonTriangulator()
skgpu::tess::MiddleOutPolygonTriangulator::MiddleOutPolygonTriangulator |
( |
int |
maxPushVertexCalls, |
|
|
SkPoint |
startPoint = {0,0} |
|
) |
| |
|
inline |
Definition at line 127 of file MiddleOutPolygonTriangulator.h.
127 {0,0}) {
129
130 int maxStackDepth =
SkNextLog2(maxPushVertexCalls) + 1;
131 if (maxStackDepth > kStackPreallocCount) {
132 fVertexStack.
reset(maxStackDepth);
133 }
134 SkDEBUGCODE(fStackAllocCount = maxStackDepth;)
135
136
137 fVertexStack[0] = {startPoint, 0};
138 fTop = fVertexStack;
139 }
static int SkNextLog2(uint32_t value)
◆ close()
◆ closeAndMove()
Definition at line 170 of file MiddleOutPolygonTriangulator.h.
170 {
171
172 SkPoint startPt = fVertexStack[0].fPoint;
173
174
175
176 StackVertex* endVertex =
std::min(fTop, fVertexStack + 1);
177
178
179 StackVertex* newTopVertex = fVertexStack;
180 StackVertex newTopValue = {newStartPoint, 0};
181
182 return PoppedTriangleStack(this, startPt, endVertex, newTopVertex, newTopValue);
183 }
static float min(float r, float g, float b)
◆ pushVertex()
Definition at line 143 of file MiddleOutPolygonTriangulator.h.
143 {
144
145
146
147
148
149
150
151
152
153 StackVertex* endVertex = fTop;
154 int vertexIdxDelta = 1;
155 while (endVertex->fVertexIdxDelta == vertexIdxDelta) {
156 --endVertex;
157 vertexIdxDelta *= 2;
158 }
159
160
161 StackVertex* newTopVertex = endVertex + 1;
162 StackVertex newTopValue = {pt, vertexIdxDelta};
163 SkASSERT(newTopVertex < fVertexStack + fStackAllocCount);
164
165 return PoppedTriangleStack(this, pt, endVertex, newTopVertex, newTopValue);
166 }
The documentation for this class was generated from the following file: