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/GrMixerEffect.cpp b/src/gpu/effects/generated/GrMixerEffect.cpp
index af5a7af..4ffa89c 100644
--- a/src/gpu/effects/generated/GrMixerEffect.cpp
+++ b/src/gpu/effects/generated/GrMixerEffect.cpp
@@ -28,19 +28,17 @@
weightVar =
args.fUniformHandler->addUniform(kFragment_GrShaderFlag, kHalf_GrSLType, "weight");
SkString _input0 = SkStringPrintf("%s", args.fInputColor);
- SkString _child0("_child0");
- this->emitChild(_outer.fp0_index, _input0.c_str(), &_child0, args);
- fragBuilder->codeAppendf("half4 in0 = %s;", _child0.c_str());
+ fragBuilder->codeAppendf("half4 _process1272;");
+ this->invokeChild(_outer.fp0_index, _input0.c_str(), "_process1272", args);
+ fragBuilder->codeAppendf("half4 in0 = _process1272;");
SkString _input1 = SkStringPrintf("%s", args.fInputColor);
- SkString _child1("_child1");
+ fragBuilder->codeAppendf("half4 _process1330;");
if (_outer.fp1_index >= 0) {
- this->emitChild(_outer.fp1_index, _input1.c_str(), &_child1, args);
- } else {
- fragBuilder->codeAppendf("half4 %s;", _child1.c_str());
+ this->invokeChild(_outer.fp1_index, _input1.c_str(), "_process1330", args);
}
- fragBuilder->codeAppendf("\nhalf4 in1 = %s ? %s : %s;\n%s = mix(in0, in1, %s);\n",
- _outer.fp1_index >= 0 ? "true" : "false", _child1.c_str(),
- args.fInputColor, args.fOutputColor,
+ fragBuilder->codeAppendf("\nhalf4 in1 = %s ? _process1330 : %s;\n%s = mix(in0, in1, %s);\n",
+ _outer.fp1_index >= 0 ? "true" : "false", args.fInputColor,
+ args.fOutputColor,
args.fUniformHandler->getUniformCStr(weightVar));
}