• Home
  • Raw
  • Download

Lines Matching refs:fragBuilder

31         GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;  in onEmitCode()  local
56 fragBuilder->codeAppendf("half4 %s;\n", args.fOutputColor); in onEmitCode()
84 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
85 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
89 fragBuilder->codeAppend("half distance = " in onEmitCode()
93 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
96 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
104 fragBuilder->codeAppendf( in onEmitCode()
107 fragBuilder->codeAppendf( in onEmitCode()
118 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdy(%s)));", st.fsIn()); in onEmitCode()
120 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdx(%s)));", st.fsIn()); in onEmitCode()
122 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
127 fragBuilder->codeAppend("half2 dist_grad = half2(float2(dFdx(distance), " in onEmitCode()
131 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
132 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
133 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
134 fragBuilder->codeAppend("} else {"); in onEmitCode()
135 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode()
136 fragBuilder->codeAppend("}"); in onEmitCode()
138 fragBuilder->codeAppendf("half2 Jdx = half2(dFdx(%s));", st.fsIn()); in onEmitCode()
139 fragBuilder->codeAppendf("half2 Jdy = half2(dFdy(%s));", st.fsIn()); in onEmitCode()
140 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
141 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
144 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
148 fragBuilder->codeAppend("half val = distance > 0 ? 1.0 : 0.0;"); in onEmitCode()
153 fragBuilder->codeAppend( in onEmitCode()
156 fragBuilder->codeAppend("half val = smoothstep(-afwidth, afwidth, distance);"); in onEmitCode()
159 fragBuilder->codeAppendf("half4 %s = half4(val);", args.fOutputCoverage); in onEmitCode()
329 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
351 fragBuilder->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode()
377 fragBuilder->codeAppendf("float2 uv = %s;", uv.fsIn()); in onEmitCode()
378 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
382 fragBuilder->codeAppend("half distance = " in onEmitCode()
385 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
398 fragBuilder->codeAppendf( in onEmitCode()
401 fragBuilder->codeAppendf( in onEmitCode()
411 fragBuilder->codeAppendf("half st_grad_len = half(length(dFdy(%s)));", st.fsIn()); in onEmitCode()
413 fragBuilder->codeAppendf("half st_grad_len = half(length(dFdx(%s)));", st.fsIn()); in onEmitCode()
415 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
420 fragBuilder->codeAppend("half2 dist_grad = half2(dFdx(distance), " in onEmitCode()
424 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
425 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
426 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
427 fragBuilder->codeAppend("} else {"); in onEmitCode()
428 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode()
429 fragBuilder->codeAppend("}"); in onEmitCode()
431 fragBuilder->codeAppendf("half2 Jdx = half2(dFdx(%s));", st.fsIn()); in onEmitCode()
432 fragBuilder->codeAppendf("half2 Jdy = half2(dFdy(%s));", st.fsIn()); in onEmitCode()
433 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
434 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
437 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
443 fragBuilder->codeAppend( in onEmitCode()
446 fragBuilder->codeAppend("half val = smoothstep(-afwidth, afwidth, distance);"); in onEmitCode()
449 fragBuilder->codeAppendf("half4 %s = half4(val);", args.fOutputCoverage); in onEmitCode()
617 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
620 fragBuilder->codeAppendf("half4 %s;\n", args.fOutputColor); in onEmitCode()
656 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
660 fragBuilder->codeAppendf("half st_grad_len = half(abs(dFdy(%s.y)));", st.fsIn()); in onEmitCode()
662 fragBuilder->codeAppendf("half st_grad_len = half(abs(dFdx(%s.x)));", st.fsIn()); in onEmitCode()
664 fragBuilder->codeAppendf("half2 offset = half2(half(st_grad_len*%s), 0.0);", in onEmitCode()
672 fragBuilder->codeAppendf("half2 st_grad = half2(dFdy(%s));", st.fsIn()); in onEmitCode()
673 fragBuilder->codeAppendf("half2 offset = half2(%s*float2(st_grad.y, -st_grad.x));", in onEmitCode()
676 fragBuilder->codeAppendf("half2 st_grad = half2(dFdx(%s));", st.fsIn()); in onEmitCode()
677 fragBuilder->codeAppendf("half2 offset = half(%s)*st_grad;", delta.fsIn()); in onEmitCode()
679 fragBuilder->codeAppend("half st_grad_len = length(st_grad);"); in onEmitCode()
681 fragBuilder->codeAppendf("half2 st = half2(%s);\n", st.fsIn()); in onEmitCode()
683 fragBuilder->codeAppend("half2 Jdx = half2(dFdx(st));"); in onEmitCode()
684 fragBuilder->codeAppend("half2 Jdy = half2(dFdy(st));"); in onEmitCode()
685 fragBuilder->codeAppendf("half2 offset = half2(half(%s))*Jdx;", delta.fsIn()); in onEmitCode()
689 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
694 fragBuilder->codeAppend("half3 distance;"); in onEmitCode()
695 fragBuilder->codeAppend("distance.y = texColor.r;"); in onEmitCode()
697 fragBuilder->codeAppend("half2 uv_adjusted = half2(uv) - offset;"); in onEmitCode()
700 fragBuilder->codeAppend("distance.x = texColor.r;"); in onEmitCode()
702 fragBuilder->codeAppend("uv_adjusted = half2(uv) + offset;"); in onEmitCode()
705 fragBuilder->codeAppend("distance.z = texColor.r;"); in onEmitCode()
707 fragBuilder->codeAppend("distance = " in onEmitCode()
715 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
721 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
729 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*st_grad_len;"); in onEmitCode()
734 fragBuilder->codeAppend("half2 dist_grad = half2(half(dFdx(distance.r)), " in onEmitCode()
738 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
739 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
740 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
741 fragBuilder->codeAppend("} else {"); in onEmitCode()
742 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode()
743 fragBuilder->codeAppend("}"); in onEmitCode()
744 fragBuilder->codeAppend("half2 grad = half2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,"); in onEmitCode()
745 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);"); in onEmitCode()
748 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);"); in onEmitCode()
755 fragBuilder->codeAppendf("half4 %s = " in onEmitCode()
759 fragBuilder->codeAppendf( in onEmitCode()