Child fragment processors are now written as separate functions
instead of inline
Bug: skia:
Change-Id: I3c6c876fea9cfcc311fc09c0fdf0375b776004aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210632
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/effects/generated/GrComposeLerpEffect.cpp b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
index c9b4d3b..72a46d2 100644
--- a/src/gpu/effects/generated/GrComposeLerpEffect.cpp
+++ b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
@@ -27,23 +27,19 @@
(void)weight;
weightVar =
args.fUniformHandler->addUniform(kFragment_GrShaderFlag, kFloat_GrSLType, "weight");
- SkString _child0("_child0");
+ fragBuilder->codeAppendf("half4 _process284;");
if (_outer.child1_index >= 0) {
- this->emitChild(_outer.child1_index, &_child0, args);
- } else {
- fragBuilder->codeAppendf("half4 %s;", _child0.c_str());
+ this->invokeChild(_outer.child1_index, "_process284", args);
}
- SkString _child1("_child1");
+ fragBuilder->codeAppendf("half4 _process353;");
if (_outer.child2_index >= 0) {
- this->emitChild(_outer.child2_index, &_child1, args);
- } else {
- fragBuilder->codeAppendf("half4 %s;", _child1.c_str());
+ this->invokeChild(_outer.child2_index, "_process353", args);
}
- fragBuilder->codeAppendf("%s = mix(%s ? %s : %s, %s ? %s : %s, half(%s));\n",
- args.fOutputColor, _outer.child1_index >= 0 ? "true" : "false",
- _child0.c_str(), args.fInputColor,
- _outer.child2_index >= 0 ? "true" : "false", _child1.c_str(),
- args.fInputColor, args.fUniformHandler->getUniformCStr(weightVar));
+ fragBuilder->codeAppendf(
+ "%s = mix(%s ? _process284 : %s, %s ? _process353 : %s, half(%s));\n",
+ args.fOutputColor, _outer.child1_index >= 0 ? "true" : "false", args.fInputColor,
+ _outer.child2_index >= 0 ? "true" : "false", args.fInputColor,
+ args.fUniformHandler->getUniformCStr(weightVar));
}
private: