Lines Matching defs:body
68 const char* body) {
72 "}\n\n", body);
75 void GrGLSLShaderBuilder::emitFunction(const char* declaration, const char* body) {
78 "}\n\n", declaration, body);
175 SkString body;
178 body.appendf("half G = %s[0];", coeffs);
179 body.appendf("half A = %s[1];", coeffs);
180 body.appendf("half B = %s[2];", coeffs);
181 body.appendf("half C = %s[3];", coeffs);
182 body.appendf("half D = %s[4];", coeffs);
183 body.appendf("half E = %s[5];", coeffs);
184 body.appendf("half F = %s[6];", coeffs);
185 body.append("half s = sign(x);");
186 body.append("x = abs(x);");
189 body.append("x = (x < D) ? (C * x) + F : pow(A * x + B, G) + E;");
192 body.append("x = pow(max(A + B * pow(x, C), 0) / (D + E * pow(x, C)), F);");
195 body.append("x = (x*A <= 1) ? pow(x*A, B) : exp((x-E)*C) + D; x *= (F+1);");
198 body.append("x /= (F+1); x = (x <= 1) ? A * pow(x, B) : C * log(x - D) + E;");
204 body.append("return s * x;");
207 body.c_str());
227 SkString body;
228 body.appendf("color.rgb = (%s * color.rgb);", xform);
229 body.append("return color;");
232 {gGamutXformArgs, SK_ARRAY_COUNT(gGamutXformArgs)}, body.c_str());
245 SkString body;
247 body.append("color = unpremul(color);");
250 body.appendf("color.r = %s(half(color.r));", srcTFFuncName.c_str());
251 body.appendf("color.g = %s(half(color.g));", srcTFFuncName.c_str());
252 body.appendf("color.b = %s(half(color.b));", srcTFFuncName.c_str());
255 body.appendf("color = %s(half4(color));", gamutXformFuncName.c_str());
258 body.appendf("color.r = %s(half(color.r));", dstTFFuncName.c_str());
259 body.appendf("color.g = %s(half(color.g));", dstTFFuncName.c_str());
260 body.appendf("color.b = %s(half(color.b));", dstTFFuncName.c_str());
263 body.append("color.rgb *= color.a;");
265 body.append("return half4(color);");
268 {gColorXformArgs, SK_ARRAY_COUNT(gColorXformArgs)}, body.c_str());