107 float winding = (xs[0] - xs[3])*(ys[1] - ys[0]) - (ys[0] - ys[3])*(xs[1] - xs[0]);
108 if (winding == 0.f) {
110 winding = (xs[2] - xs[1])*(ys[3] - ys[2]) - (ys[2] - ys[1])*(xs[3] - xs[2]);
116 return winding >= 0.f;
181 Flags::kPerformsShading |
Flags::kEmitsCoverage |
Flags::kOutsetBoundsForAA,
219 return "float4 devPosition = per_edge_aa_quad_vertex_fn("
223 "edgeFlags, quadXs, quadYs, depth, "
224 "float3x3(mat0, mat1, mat2), "
228 "stepLocalCoords);\n";
234 return "outputCoverage = per_edge_aa_quad_coverage_fn(sk_FragCoord, edgeDistances);";
250 constexpr uint8_t kAAOn = 255;
251 constexpr uint8_t kAAOff = 0;
260 vw << edgeSigns << quad.
xs() << quad.
ys();
262 vw << skvx::shuffle<2,1,0,3>(edgeSigns)
263 << skvx::shuffle<1,0,3,2>(quad.
xs())
264 << skvx::shuffle<1,0,3,2>(quad.
ys());
270 vw <<
params.order().depthAsFloat()
272 <<
m.rc(0,0) <<
m.rc(1,0) <<
m.rc(3,0)
273 <<
m.rc(0,1) <<
m.rc(1,1) <<
m.rc(3,1)
274 <<
m.rc(0,3) <<
m.rc(1,3) <<
m.rc(3,3);
static const uint16_t kTL
static const uint16_t kBL
static const uint16_t kIndices[]
static const uint16_t kBR
static constexpr LocalCornerVert kCornerTemplate[19]
static const uint16_t kTR
static constexpr float kHR2
constexpr float SK_FloatSqrt2
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
sk_sp< const GrBuffer > fIndexBuffer
sk_sp< const GrBuffer > fVertexBuffer
const skvx::float4 & ys() const
const skvx::float4 & xs() const
SkEnumBitMask< Flags > edgeFlags() const
void writeUniformsAndTextures(const DrawParams &, PipelineDataGatherer *) const override
const char * fragmentCoverageSkSL() const override
void writeVertices(DrawWriter *, const DrawParams &, skvx::ushort2 ssboIndices) const override
std::string vertexSkSL() const override
~PerEdgeAAQuadRenderStep() override
PerEdgeAAQuadRenderStep(StaticBufferManager *bufferManager)
const EmbeddedViewParams * params
Optional< SkRect > bounds
static void write_index_buffer(VertexWriter writer)
static bool is_clockwise(const EdgeAAQuad &quad)
static constexpr DepthStencilSettings kDirectDepthGreaterPass
static constexpr int kIndexCount
EdgeAAQuad::Flags AAFlags
static constexpr int kCornerVertexCount
static constexpr int kVertexCount
static void write_vertex_buffer(VertexWriter writer)