Home | History | Annotate | Download | only in effects

Lines Matching refs:codeAppend

98         fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps,
102 fragBuilder->codeAppend("\tfloat texColor = ");
106 fragBuilder->codeAppend(".r;\n");
107 fragBuilder->codeAppend("\tfloat distance = "
114 fragBuilder->codeAppend("float afwidth;");
128 fragBuilder->codeAppend("vec2 dist_grad = vec2(dFdx(distance), dFdy(distance));");
131 fragBuilder->codeAppend("float dg_len2 = dot(dist_grad, dist_grad);");
132 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {");
133 fragBuilder->codeAppend("dist_grad = vec2(0.7071, 0.7071);");
134 fragBuilder->codeAppend("} else {");
135 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);");
136 fragBuilder->codeAppend("}");
140 fragBuilder->codeAppend("vec2 grad = vec2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,");
141 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);");
144 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);");
146 fragBuilder->codeAppend("float val = smoothstep(-afwidth, afwidth, distance);");
322 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps,
326 fragBuilder->codeAppend("float texColor = ");
330 fragBuilder->codeAppend(".r;");
331 fragBuilder->codeAppend("float distance = "
334 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps,
337 fragBuilder->codeAppend("float afwidth;");
344 fragBuilder->codeAppend
349 fragBuilder->codeAppend("vec2 dist_grad = vec2(dFdx(distance), dFdy(distance));");
352 fragBuilder->codeAppend("float dg_len2 = dot(dist_grad, dist_grad);");
353 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {");
354 fragBuilder->codeAppend("dist_grad = vec2(0.7071, 0.7071);");
355 fragBuilder->codeAppend("} else {");
356 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);");
357 fragBuilder->codeAppend("}");
359 fragBuilder->codeAppend("vec2 Jdx = dFdx(st);");
360 fragBuilder->codeAppend("vec2 Jdy = dFdy(st);");
361 fragBuilder->codeAppend("vec2 grad = vec2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,");
362 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);");
365 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);");
367 fragBuilder->codeAppend("float val = smoothstep(-afwidth, afwidth, distance);");
545 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps,
548 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps,
559 fragBuilder->codeAppend("vec2 offset = vec2(dy*delta, 0.0);");
563 fragBuilder->codeAppend("vec2 Jdx = dFdx(st);");
564 fragBuilder->codeAppend("vec2 Jdy = dFdy(st);");
565 fragBuilder->codeAppend("vec2 offset = delta*Jdx;");
569 fragBuilder->codeAppend("\tvec4 texColor = ");
571 fragBuilder->codeAppend(";\n");
572 fragBuilder->codeAppend("\tvec3 distance;\n");
573 fragBuilder->codeAppend("\tdistance.y = texColor.r;\n");
575 fragBuilder->codeAppend("\tvec2 uv_adjusted = uv - offset;\n");
576 fragBuilder->codeAppend("\ttexColor = ");
578 fragBuilder->codeAppend(";\n");
579 fragBuilder->codeAppend("\tdistance.x = texColor.r;\n");
581 fragBuilder->codeAppend("\tuv_adjusted = uv + offset;\n");
582 fragBuilder->codeAppend("\ttexColor = ");
584 fragBuilder->codeAppend(";\n");
585 fragBuilder->codeAppend("\tdistance.z = texColor.r;\n");
587 fragBuilder->codeAppend("\tdistance = "
601 fragBuilder->codeAppend("float afwidth;");
608 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*dy;");
613 fragBuilder->codeAppend("vec2 dist_grad = vec2(dFdx(distance.r), dFdy(distance.r));");
616 fragBuilder->codeAppend("float dg_len2 = dot(dist_grad, dist_grad);");
617 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {");
618 fragBuilder->codeAppend("dist_grad = vec2(0.7071, 0.7071);");
619 fragBuilder->codeAppend("} else {");
620 fragBuilder->codeAppend("dist_grad = dist_grad*inversesqrt(dg_len2);");
621 fragBuilder->codeAppend("}");
622 fragBuilder->codeAppend("vec2 grad = vec2(dist_grad.x*Jdx.x + dist_grad.y*Jdy.x,");
623 fragBuilder->codeAppend(" dist_grad.x*Jdx.y + dist_grad.y*Jdy.y);");
626 fragBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*length(grad);");
629 fragBuilder->codeAppend(
632 fragBuilder->codeAppend("val.a = max(max(val.r, val.g), val.b);");