Lines Matching refs:fsBuilder
735 GrGLSLFragmentBuilder* fsBuilder = args.fFragBuilder;
737 SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
819 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(),
830 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(),
855 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
867 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
883 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
895 fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
908 fsBuilder->emitFunction(kFloat_GrSLType,
912 fsBuilder->emitFunction(kFloat_GrSLType,
918 fsBuilder->codeAppendf("\n\t\tvec2 %s = floor(%s.xy) * %s;",
922 fsBuilder->codeAppendf("\n\t\t%s = vec4(0.0);", args.fOutputColor);
926 fsBuilder->codeAppendf("\n\t\tvec2 %s = %s;", stitchData, stitchDataUni);
929 fsBuilder->codeAppendf("\n\t\tfloat %s = 1.0;", ratio);
932 fsBuilder->codeAppendf("for (int octave = 0; octave < %d; ++octave) {", pne.numOctaves());
934 fsBuilder->codeAppendf("\n\t\t\t%s += ", args.fOutputColor);
936 fsBuilder->codeAppend("abs(");
939 fsBuilder->codeAppendf(
947 fsBuilder->codeAppendf(
956 fsBuilder->codeAppendf(")"); // end of "abs("
958 fsBuilder->codeAppendf(" * %s;", ratio);
960 fsBuilder->codeAppendf("\n\t\t\t%s *= vec2(2.0);", noiseVec);
961 fsBuilder->codeAppendf("\n\t\t\t%s *= 0.5;", ratio);
964 fsBuilder->codeAppendf("\n\t\t\t%s *= vec2(2.0);", stitchData);
966 fsBuilder->codeAppend("\n\t\t}"); // end of the for loop on octaves
971 fsBuilder->codeAppendf("\n\t\t%s = %s * vec4(0.5) + vec4(0.5);",
976 fsBuilder->codeAppendf("\n\t\t%s = clamp(%s, 0.0, 1.0);", args.fOutputColor, args.fOutputColor);
979 fsBuilder->codeAppendf("\n\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n",
1138 GrGLSLFragmentBuilder* fsBuilder = args.fFragBuilder;
1140 SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
1162 fsBuilder->emitFunction(kVec3f_GrSLType, "fade", SK_ARRAY_COUNT(fadeArgs),
1175 fsBuilder->appendTextureLookup(&permCode, args.fSamplers[0], "vec2(fract(x / 256.0), 0.0)",
1178 fsBuilder->emitFunction(kFloat_GrSLType, "perm", SK_ARRAY_COUNT(permArgs), permArgs,
1188 fsBuilder->appendTextureLookup(&gradCode, args.fSamplers[1], "vec2(fract(x / 16.0), 0.0)",
1191 fsBuilder->emitFunction(kFloat_GrSLType, "grad", SK_ARRAY_COUNT(gradArgs), gradArgs,
1201 fsBuilder->emitFunction(kFloat_GrSLType, "lerp", SK_ARRAY_COUNT(lerpArgs), lerpArgs,
1238 fsBuilder->emitFunction(kFloat_GrSLType, "noise", SK_ARRAY_COUNT(noiseArgs), noiseArgs,
1256 fsBuilder->emitFunction(kFloat_GrSLType, "noiseOctaves", SK_ARRAY_COUNT(noiseOctavesArgs),
1259 fsBuilder->codeAppendf("vec2 coords = %s * %s;", vCoords.c_str(), baseFrequencyUni);
1260 fsBuilder->codeAppendf("float r = %s(vec3(coords, %s), %s);", noiseOctavesFuncName.c_str(),
1262 fsBuilder->codeAppendf("float g = %s(vec3(coords, %s + 0000.0), %s);",
1264 fsBuilder->codeAppendf("float b = %s(vec3(coords, %s + 0000.0), %s);",
1266 fsBuilder->codeAppendf("float a = %s(vec3(coords, %s + 0000.0), %s);",
1268 fsBuilder->codeAppendf("%s = vec4(r, g, b, a);", args.fOutputColor);
1271 fsBuilder->codeAppendf("%s = clamp(%s, 0.0, 1.0);", args.fOutputColor, args.fOutputColor);
1274 fsBuilder->codeAppendf("\n\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n",