Lines Matching refs:codeAppendf
386 v->codeAppendf( "%s.xy = float2(0, coverage);", arcCoord.vsOut()); in onEmitCode()
394 v->codeAppendf( "%s.xy = float2(arccoord.x+1, arccoord.y);", arcCoord.vsOut()); in onEmitCode()
397 v->codeAppendf("float2x2 derivatives = inverse(skewmatrix);"); in onEmitCode()
398 v->codeAppendf("%s.zw = derivatives * (arccoord/radii * 2);", arcCoord.vsOut()); in onEmitCode()
405 f->codeAppendf("float x_plus_1=%s.x, y=%s.y;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode()
406 f->codeAppendf("half coverage;"); in onEmitCode()
407 f->codeAppendf("if (0 == x_plus_1) {"); in onEmitCode()
408 f->codeAppendf( "coverage = y;"); // We are a non-arc pixel (i.e., linear coverage). in onEmitCode()
409 f->codeAppendf("} else {"); in onEmitCode()
410 f->codeAppendf( "float fn = x_plus_1 * (x_plus_1 - 2);"); // fn = (x+1)*(x-1) = x^2-1 in onEmitCode()
411 f->codeAppendf( "fn = fma(y,y, fn);"); // fn = x^2 + y^2 - 1 in onEmitCode()
413 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode()
416 f->codeAppendf("float gx=%s.z, gy=%s.w;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode()
417 f->codeAppendf("float fnwidth = abs(gx) + abs(gy);"); in onEmitCode()
419 f->codeAppendf( "half d = fn/fnwidth;"); in onEmitCode()
420 f->codeAppendf( "coverage = clamp(.5 - d, 0, 1);"); in onEmitCode()
421 f->codeAppendf("}"); in onEmitCode()
422 f->codeAppendf("%s = half4(coverage);", args.fOutputCoverage); in onEmitCode()