Lines Matching full:coverage
41 const float coverage[4], in write_quad_generic()
52 // perspective and coverage mode. in write_quad_generic()
56 << If(mode == CoverageMode::kWithPosition, coverage[i]); in write_quad_generic()
61 *vb << GrVertexColor(color * (mode == CoverageMode::kWithColor ? coverage[i] : 1.f), in write_quad_generic()
87 // 2D (XY), no explicit coverage, vertex color, no locals, no geometry subset, no texture subsetn
93 const float coverage[4], in write_2d_color()
111 // If this is not coverage-with-alpha, make sure coverage == 1 so it doesn't do anything in write_2d_color()
112 SkASSERT(spec.coverageMode() == CoverageMode::kWithColor || coverage[i] == 1.f); in write_2d_color()
115 << GrVertexColor(color * coverage[i], wide); in write_2d_color()
119 // 2D (XY), no explicit coverage, UV locals, no color, no geometry subset, no texture subset
125 const float coverage[4], in write_2d_uv()
146 // 2D (XY), no explicit coverage, UV locals, vertex color, no geometry or texture subsets
152 const float coverage[4], in write_2d_color_uv()
168 // If this is not coverage-with-alpha, make sure coverage == 1 so it doesn't do anything in write_2d_color_uv()
169 SkASSERT(spec.coverageMode() == CoverageMode::kWithColor || coverage[i] == 1.f); in write_2d_color_uv()
172 << GrVertexColor(color * coverage[i], wide) in write_2d_color_uv()
178 // 2D (XY), explicit coverage, UV locals, no color, no geometry subset, no texture subset
184 const float coverage[4], in write_2d_cov_uv()
200 << coverage[i] in write_2d_cov_uv()
212 // 2D (XY), no explicit coverage, UV locals, no color, tex subset but no geometry subset
218 const float coverage[4], in write_2d_uv_strict()
240 // 2D (XY), no explicit coverage, UV locals, vertex color, tex subset but no geometry subset
246 const float coverage[4], in write_2d_color_uv_strict()
262 // If this is not coverage-with-alpha, make sure coverage == 1 so it doesn't do anything in write_2d_color_uv_strict()
263 SkASSERT(spec.coverageMode() == CoverageMode::kWithColor || coverage[i] == 1.f); in write_2d_color_uv_strict()
266 << GrVertexColor(color * coverage[i], wide) in write_2d_color_uv_strict()
273 // 2D (XY), explicit coverage, UV locals, no color, tex subset but no geometry subset
279 const float coverage[4], in write_2d_cov_uv_strict()
295 << coverage[i] in write_2d_cov_uv_strict()
333 // Vertex colors, but no explicit coverage in GetWriteQuadProc()
335 // Non-UV with vertex colors (possibly with coverage folded into alpha) in GetWriteQuadProc()
338 // UV locals with vertex colors (possibly with coverage-as-alpha) in GetWriteQuadProc()
342 // Else fall through; this is a spec that requires vertex colors and explicit coverage, in GetWriteQuadProc()
343 // which means it's anti-aliased and the FPs don't support coverage as alpha, or in GetWriteQuadProc()
347 // UV locals with explicit coverage in GetWriteQuadProc()
383 // Must calculate inner and outer quadrilaterals for the vertex coverage ramps, and possibly in append()
391 // Our GP code expects a 0.5 outset rect (coverage is computed as 0 at the values of in append()
402 // Have to write the coverage AA vertex structure, but there's no math to be done for a in append()
403 // non-aa quad batched into a coverage AA op. in append()
407 // the coverage interpolation from 1 to 0 will not be visible. in append()
427 float coverage[4]; in append() local
428 fAAHelper.inset(edgeDistances, deviceQuad, localQuad).store(coverage); in append()
429 fWriteProc(&fVertexWriter, fVertexSpec, deviceQuad, localQuad, coverage, color, in append()
432 // Then outer vertices, which use 0.f for their coverage. If the inset was degenerate in append()
436 coverage[0] < 1.f && in append()
437 coverage[1] < 1.f && in append()
438 coverage[2] < 1.f && in append()
439 coverage[3] < 1.f; in append()
456 // No outsetting needed, just write a single quad with full coverage in append()
548 // Using a geometric subset acts as a second source of coverage and folding in coverageMode()
549 // the original coverage into color makes it impossible to apply the color's in coverageMode()
550 // alpha to the geometric subset's coverage when the original shape is clipped. in coverageMode()
663 // and coverage mode, 00 for none, 01 for withposition, 10 for withcolor, 11 for in addToKey()
698 // Strip last channel from the vertex attribute to remove coverage and get the in makeProgramImpl()
712 // No coverage to eliminate in makeProgramImpl()
725 // The color cannot be flat if the varying coverage has been modulated into it in makeProgramImpl()
784 // And lastly, output the coverage calculation code in makeProgramImpl()
786 GrGLSLVarying coverage(kFloat_GrSLType); in makeProgramImpl() local
787 args.fVaryingHandler->addVarying("coverage", &coverage); in makeProgramImpl()
790 // the fragment shader to get screen-space linear coverage. in makeProgramImpl()
792 coverage.vsOut(), gp.fPosition.name(), in makeProgramImpl()
794 args.fFragBuilder->codeAppendf("float coverage = %s * sk_FragCoord.w;", in makeProgramImpl()
795 coverage.fsIn()); in makeProgramImpl()
798 coverage.vsOut(), gp.fCoverage.name()); in makeProgramImpl()
799 args.fFragBuilder->codeAppendf("float coverage = %s;", coverage.fsIn()); in makeProgramImpl()
805 // coverage. This only has to be done in the exterior triangles, the in makeProgramImpl()
813 "if (coverage < 0.5) {" in makeProgramImpl()
817 " coverage = min(coverage, dists2.x * dists2.y);" in makeProgramImpl()
827 "coverage = min(coverage, subsetCoverage);"); in makeProgramImpl()
831 args.fFragBuilder->codeAppendf("half4 %s = half4(half(coverage));", in makeProgramImpl()
834 // Set coverage to 1, since it's either non-AA or the coverage was already in makeProgramImpl()
885 fCoverage = {"coverage", kFloat_GrVertexAttribType, kFloat_GrSLType}; in initializeAttrs()
921 Attribute fPosition; // May contain coverage as last channel
923 Attribute fColor; // May have coverage modulated in if the FPs support it
928 // The positions attribute may have coverage built into it, so float3 is an ambiguous type
929 // and may mean 2d with coverage, or 3d with no coverage