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/GrComposeLerpRedEffect.cpp b/src/gpu/effects/generated/GrComposeLerpRedEffect.cpp
index d75b411..a2f051b 100644
--- a/src/gpu/effects/generated/GrComposeLerpRedEffect.cpp
+++ b/src/gpu/effects/generated/GrComposeLerpRedEffect.cpp
@@ -23,24 +23,20 @@
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
const GrComposeLerpRedEffect& _outer = args.fFp.cast<GrComposeLerpRedEffect>();
(void)_outer;
- SkString _child0("_child0");
+ fragBuilder->codeAppendf("half4 _process286;");
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, "_process286", args);
}
- SkString _child1("_child1");
+ fragBuilder->codeAppendf("half4 _process355;");
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, "_process355", args);
}
- SkString _child2("_child2");
- this->emitChild(_outer.lerp_index, &_child2, args);
- fragBuilder->codeAppendf("%s = mix(%s ? %s : %s, %s ? %s : %s, %s.x);\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, _child2.c_str());
+ fragBuilder->codeAppendf("half4 _process407;");
+ this->invokeChild(_outer.lerp_index, "_process407", args);
+ fragBuilder->codeAppendf(
+ "%s = mix(%s ? _process286 : %s, %s ? _process355 : %s, _process407.x);\n",
+ args.fOutputColor, _outer.child1_index >= 0 ? "true" : "false", args.fInputColor,
+ _outer.child2_index >= 0 ? "true" : "false", args.fInputColor);
}
private: