Lines Matching refs:fragBuilder
246 static void add_avoid_code(GrGLSLFragmentBuilder* fragBuilder, in add_avoid_code() argument
253 fragBuilder->codeAppendf("vec3 temp = %s.rgb - %s.rgb;", dstColor, kColorAndTolUni); in add_avoid_code()
254 fragBuilder->codeAppendf("float dist = max(max(abs(temp.r), abs(temp.g)), abs(temp.b));"); in add_avoid_code()
257 fragBuilder->codeAppendf("dist = 1.0 - dist;"); in add_avoid_code()
261 fragBuilder->codeAppendf("dist = dist * %s.a - (%s.a - 1.0);", in add_avoid_code()
264 fragBuilder->codeAppendf("vec4 %s = vec4(dist);", kCoverageName); in add_avoid_code()
266 fragBuilder->codeAppendf("%s *= %s;", kCoverageName, srcCoverage); in add_avoid_code()
275 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
288 add_avoid_code(fragBuilder, in emitCode()
294 fragBuilder->codeAppendf("if (%s.r < 0.0039) { %s = %s; } else {", in emitCode()
296 fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0)-%s) * %s;", in emitCode()
300 fragBuilder->codeAppend("}"); in emitCode()
406 void emitBlendCodeForDstRead(GrGLSLXPFragmentBuilder* fragBuilder, in emitBlendCodeForDstRead() argument
424 add_avoid_code(fragBuilder, in emitBlendCodeForDstRead()
430 fragBuilder->codeAppendf("if (%s.r < 0.0039) { %s = %s; } else {", in emitBlendCodeForDstRead()
432 fragBuilder->codeAppendf("%s = %s;", outColor, srcColor ? srcColor : "vec4(1.0)"); in emitBlendCodeForDstRead()
433 INHERITED::DefaultCoverageModulation(fragBuilder, kCoverageName, dstColor, outColor, in emitBlendCodeForDstRead()
435 fragBuilder->codeAppend("}"); in emitBlendCodeForDstRead()