• Home
  • Raw
  • Download

Lines Matching refs:fragBuilder

32         GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;  in onEmitCode()  local
86 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
87 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
91 fragBuilder->codeAppend("half distance = " in onEmitCode()
95 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
98 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
106 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode()
110 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode()
121 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode()
124 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode()
126 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
131 fragBuilder->codeAppend("half2 dist_grad = half2(dFdx(distance), dFdy(distance));"); in onEmitCode()
134 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
135 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
136 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
137 fragBuilder->codeAppend("} else {"); in onEmitCode()
138 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);"); in onEmitCode()
139 fragBuilder->codeAppend("}"); in onEmitCode()
141 fragBuilder->codeAppendf("half2 Jdx = dFdx(%s);", st.fsIn()); in onEmitCode()
142 fragBuilder->codeAppendf("half2 Jdy = dFdy(%s);", st.fsIn()); in onEmitCode()
143 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
144 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
147 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
151 fragBuilder->codeAppend("half val = distance > 0 ? 1.0 : 0.0;"); in onEmitCode()
156 fragBuilder->codeAppend( in onEmitCode()
159 fragBuilder->codeAppend("half val = smoothstep(-afwidth, afwidth, distance);"); in onEmitCode()
162 fragBuilder->codeAppendf("%s = half4(val);", args.fOutputCoverage); in onEmitCode()
331 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
386 fragBuilder->codeAppendf("float2 uv = %s;", uv.fsIn()); in onEmitCode()
387 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
391 fragBuilder->codeAppend("half distance = " in onEmitCode()
394 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
407 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode()
411 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode()
421 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode()
424 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode()
426 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
431 fragBuilder->codeAppend("half2 dist_grad = half2(dFdx(distance), dFdy(distance));"); in onEmitCode()
434 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
435 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
436 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
437 fragBuilder->codeAppend("} else {"); in onEmitCode()
438 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);"); in onEmitCode()
439 fragBuilder->codeAppend("}"); in onEmitCode()
441 fragBuilder->codeAppendf("half2 Jdx = dFdx(%s);", st.fsIn()); in onEmitCode()
442 fragBuilder->codeAppendf("half2 Jdy = dFdy(%s);", st.fsIn()); in onEmitCode()
443 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
444 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
447 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
453 fragBuilder->codeAppend( in onEmitCode()
456 fragBuilder->codeAppend("half val = smoothstep(-afwidth, afwidth, distance);"); in onEmitCode()
459 fragBuilder->codeAppendf("%s = half4(val);", args.fOutputCoverage); in onEmitCode()
635 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
676 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
680 fragBuilder->codeAppendf("half st_grad_len = abs(dFdx(%s.x));", st.fsIn()); in onEmitCode()
683 fragBuilder->codeAppendf("half st_grad_len = abs(dFdy(%s.y));", st.fsIn()); in onEmitCode()
685 fragBuilder->codeAppendf("half2 offset = half2(st_grad_len*%s, 0.0);", delta.fsIn()); in onEmitCode()
690 fragBuilder->codeAppendf("half2 st_grad = dFdx(%s);", st.fsIn()); in onEmitCode()
691 fragBuilder->codeAppendf("half2 offset = %s*st_grad;", delta.fsIn()); in onEmitCode()
695 fragBuilder->codeAppendf("half2 st_grad = dFdy(%s);", st.fsIn()); in onEmitCode()
696 fragBuilder->codeAppendf("half2 offset = %s*half2(st_grad.y, -st_grad.x);", in onEmitCode()
699 fragBuilder->codeAppend("half st_grad_len = length(st_grad);"); in onEmitCode()
701 fragBuilder->codeAppendf("half2 st = %s;\n", st.fsIn()); in onEmitCode()
703 fragBuilder->codeAppend("half2 Jdx = dFdx(st);"); in onEmitCode()
704 fragBuilder->codeAppend("half2 Jdy = dFdy(st);"); in onEmitCode()
705 fragBuilder->codeAppendf("half2 offset = %s*Jdx;", delta.fsIn()); in onEmitCode()
709 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
714 fragBuilder->codeAppend("half3 distance;"); in onEmitCode()
715 fragBuilder->codeAppend("distance.y = texColor.r;"); in onEmitCode()
717 fragBuilder->codeAppend("half2 uv_adjusted = uv - offset;"); in onEmitCode()
720 fragBuilder->codeAppend("distance.x = texColor.r;"); in onEmitCode()
722 fragBuilder->codeAppend("uv_adjusted = uv + offset;"); in onEmitCode()
725 fragBuilder->codeAppend("distance.z = texColor.r;"); in onEmitCode()
727 fragBuilder->codeAppend("distance = " in onEmitCode()
734 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
740 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
748 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*st_grad_len;"); in onEmitCode()
753 fragBuilder->codeAppend("half2 dist_grad = half2(dFdx(distance.r), dFdy(distance.r));"); in onEmitCode()
756 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
757 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
758 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
759 fragBuilder->codeAppend("} else {"); in onEmitCode()
760 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);"); in onEmitCode()
761 fragBuilder->codeAppend("}"); in onEmitCode()
762 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
763 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
766 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
773 fragBuilder->codeAppendf("%s = " in onEmitCode()
777 fragBuilder->codeAppendf( in onEmitCode()