39static constexpr PatchAttribs kAttribs = PatchAttribs::kJoinControlPoint |
40 PatchAttribs::kStrokeParams |
41 PatchAttribs::kPaintDepth |
42 PatchAttribs::kSsboIndex;
43static constexpr PatchAttribs kAttribsWithCurveType = kAttribs | PatchAttribs::kExplicitCurveType;
56static constexpr Attribute kBaseAttributes[] = {
64static constexpr Attribute kAttributesWithCurveType[] = {
81 Flags::kRequiresMSAA |
Flags::kPerformsShading,
89 , fInfinitySupport(infinitySupport) {}
98 float edgeID = float(sk_VertexID >> 1);
99 if ((sk_VertexID & 1) != 0) {
102 float2x2 affine = float2x2(affineMatrix.xy, affineMatrix.zw);
103 float4 devAndLocalCoords = tessellate_stroked_curve(
104 edgeID, 16383, affine, translate, maxScale, p01, p23, prevPoint,
106 float4 devPosition = float4(devAndLocalCoords.xy, depth, 1.0);
107 stepLocalCoords = devAndLocalCoords.zw;
109 fInfinitySupport ? "curve_type_using_inf_support(p23)" :
"curveType");
123 Writer writer{fInfinitySupport ? kAttribs : kAttribsWithCurveType,
128 writer.updatePaintDepthAttrib(
params.order().depthAsFloat());
129 writer.updateSsboIndexAttrib(ssboIndices);
136 params.transform().maxScaleFactor());
139 writer.updateStrokeParamsAttrib({
params.strokeStyle().halfWidth(),
140 params.strokeStyle().joinLimit()});
150 params.strokeStyle().join(),
151 params.strokeStyle().miterLimit());
153 while (strokeIter.next()) {
155 const SkPoint*
p = strokeIter.pts();
161 switch (strokeIter.verb()) {
162 case Verb::kContourFinished:
163 writer.writeDeferredStrokePatch();
167 writer.writeCircle(
p[0]);
169 case Verb::kMoveWithinContour:
172 writer.updateJoinControlPointAttrib(
p[0]);
175 writer.writeLine(
p[0],
p[1]);
181 writer.writeCircle(cusp);
183 writer.writeLine(
p[0], cusp);
184 writer.writeLine(cusp,
p[2]);
186 writer.writeQuadratic(
p);
194 writer.writeCircle(cusp);
196 writer.writeLine(
p[0], cusp);
197 writer.writeLine(cusp,
p[2]);
199 writer.writeConic(
p, strokeIter.w());
208 writer.writeCubic(
p);
209 }
else if (numChops == 1) {
212 writer.writeCircle(chops[3]);
215 chops[2] = chops[4] = chops[3];
217 writer.writeCubic(chops);
218 writer.writeCubic(chops + 3);
223 writer.writeCircle(chops[3]);
224 writer.writeCircle(chops[6]);
227 writer.writeLine(chops[0], chops[3]);
228 writer.writeLine(chops[3], chops[6]);
229 writer.writeLine(chops[6], chops[9]);
231 writer.writeCubic(chops);
232 writer.writeCubic(chops + 3);
233 writer.writeCubic(chops + 6);
242 PipelineDataGatherer* gatherer)
const {
250 SkV4 upper = {
params.transform().matrix().rc(0, 0),
params.transform().matrix().rc(1, 0),
251 params.transform().matrix().rc(0, 1),
params.transform().matrix().rc(1, 1)};
252 gatherer->write(upper);
255 params.transform().matrix().rc(1, 3)});
257 gatherer->write(
params.transform().maxScaleFactor());
float SkFindQuadMidTangent(const SkPoint src[3])
void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t)
void SkEvalQuadAt(const SkPoint src[3], SkScalar t, SkPoint *pt, SkVector *tangent)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
SkSpan< const Uniform > uniforms() const
void writeUniformsAndTextures(const DrawParams &, PipelineDataGatherer *) const override
std::string vertexSkSL() const override
~TessellateStrokesRenderStep() override
void writeVertices(DrawWriter *, const DrawParams &, skvx::ushort2 ssboIndices) const override
TessellateStrokesRenderStep(bool infinitySupport)
static constexpr int PreallocCount(int totalCombinedPathVerbCnt)
const EmbeddedViewParams * params
unsigned useCenter Optional< SkMatrix > matrix
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
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
static const std::map< std::string, VerticesBuilder::AttributeType > kAttributes
static constexpr DepthStencilSettings kDirectDepthGreaterPass
bool ConicHasCusp(const SkPoint p[3])
int FindCubicConvex180Chops(const SkPoint pts[], float T[2], bool *areCusps)