Lines Matching refs:codeAppendf
498 f->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode()
505 v->codeAppendf("float aa_bloat_multiplier = %i;", in onEmitCode()
550 v->codeAppendf("coverage = (coverage - .5) * aa_bloat_multiplier + .5;"); in onEmitCode()
624 v->codeAppendf( "%s.xy = float2(0, coverage * coverage_multiplier);", in onEmitCode()
633 v->codeAppendf( "%s.xy = float2(arccoord.x+1, arccoord.y);", arcCoord.vsOut()); in onEmitCode()
636 v->codeAppendf("float2x2 derivatives = inverse(skewmatrix);"); in onEmitCode()
637 v->codeAppendf("%s.zw = derivatives * (arccoord/radii * 2);", arcCoord.vsOut()); in onEmitCode()
642 f->codeAppendf("float x_plus_1=%s.x, y=%s.y;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode()
643 f->codeAppendf("half coverage;"); in onEmitCode()
644 f->codeAppendf("if (0 == x_plus_1) {"); in onEmitCode()
645 f->codeAppendf( "coverage = half(y);"); // We are a non-arc pixel (linear coverage). in onEmitCode()
646 f->codeAppendf("} else {"); in onEmitCode()
647 f->codeAppendf( "float fn = x_plus_1 * (x_plus_1 - 2);"); // fn = (x+1)*(x-1) = x^2-1 in onEmitCode()
648 f->codeAppendf( "fn = fma(y,y, fn);"); // fn = x^2 + y^2 - 1 in onEmitCode()
650 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode()
653 f->codeAppendf("float gx=%s.z, gy=%s.w;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode()
654 f->codeAppendf("float fnwidth = abs(gx) + abs(gy);"); in onEmitCode()
656 f->codeAppendf( "coverage = .5 - half(fn/fnwidth);"); in onEmitCode()
659 f->codeAppendf("}"); in onEmitCode()
661 f->codeAppendf("coverage = clamp(coverage, 0, 1);"); in onEmitCode()
664 f->codeAppendf("}"); in onEmitCode()
667 f->codeAppendf("coverage = (coverage >= .5) ? 1 : 0;"); in onEmitCode()
669 f->codeAppendf("half4 %s = half4(coverage);", args.fOutputCoverage); in onEmitCode()