Lines Matching refs:fragBuilder
165 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitKernelBlock() local
172 fragBuilder->codeAppendf("for (int i = 0; i < %d; ++i)", (int)kernelArea); in emitKernelBlock()
175 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitKernelBlock()
177 fragBuilder->codeAppend("half k;"); in emitKernelBlock()
178 fragBuilder->codeAppend("half2 sourceOffset;"); in emitKernelBlock()
182 fragBuilder->codeAppendf("k = %s.w + %s;", kernelSample.c_str(), kernelBias); in emitKernelBlock()
183 fragBuilder->codeAppendf("sourceOffset.y = floor(half(i) / %d);", kernelWidth); in emitKernelBlock()
184 fragBuilder->codeAppendf("sourceOffset.x = half(i) - sourceOffset.y * %d;", kernelWidth); in emitKernelBlock()
186 fragBuilder->codeAppendf("sourceOffset = half2(%d, %d);", loc.x(), loc.y()); in emitKernelBlock()
189 fragBuilder->codeAppendf("k = %s[%d][%d];", kernel, offset / 4, offset & 0x3); in emitKernelBlock()
193 fragBuilder->codeAppendf("half4 c = %s;", sample.c_str()); in emitKernelBlock()
195 fragBuilder->codeAppend("c = unpremul(c);"); in emitKernelBlock()
196 fragBuilder->codeAppend("c.rgb = saturate(c.rgb);"); in emitKernelBlock()
198 fragBuilder->codeAppend("sum += c * k;"); in emitKernelBlock()
227 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
228 fragBuilder->codeAppend("half4 sum = half4(0);"); in emitCode()
229 fragBuilder->codeAppendf("float2 coord = %s - %s;", args.fSampleCoord, kernelOffset); in emitCode()
241 fragBuilder->codeAppendf("half4 color;"); in emitCode()
243 fragBuilder->codeAppendf("color = sum * %s + %s;", gain, bias); in emitCode()
244 fragBuilder->codeAppendf("color.a = saturate(color.a);"); in emitCode()
245 fragBuilder->codeAppendf("color.rgb = clamp(color.rgb, 0.0, color.a);"); in emitCode()
248 fragBuilder->codeAppendf("half4 c = %s;", sample.c_str()); in emitCode()
249 fragBuilder->codeAppendf("color.a = c.a;"); in emitCode()
250 fragBuilder->codeAppendf("color.rgb = saturate(sum.rgb * %s + %s);", gain, bias); in emitCode()
251 fragBuilder->codeAppendf("color.rgb *= color.a;"); in emitCode()
253 fragBuilder->codeAppendf("return color;"); in emitCode()