Revert "Child fragment processors are now written as separate functions"
This reverts commit 0364bde2c49616bc9d2f68742d36bfedbeb7e950.
Reason for revert: bot breakage, e.g. https://chromium-swarm.appspot.com/task?id=44942724fab4b710 and https://chromium-swarm.appspot.com/task?id=44938767e5fbb810
Original change's description:
> 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>
TBR=ethannicholas@google.com,michaelludwig@google.com
Change-Id: If33c1f554a090cd7541878e77712d5ce968ec70a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211943
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 1cc5e71..7205f08 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -241,7 +241,7 @@
public:
void emitCode(EmitArgs& args) override {
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
- this->invokeChild(0, args);
+ this->emitChild(0, args);
fragBuilder->codeAppendf("%s.rgb *= %s.rgb;", args.fOutputColor,
args.fInputColor);
fragBuilder->codeAppendf("%s *= %s.a;", args.fOutputColor, args.fInputColor);
@@ -318,19 +318,15 @@
void emitCode(EmitArgs& args) override {
// First guy's input might be nil.
SkString temp("out0");
- GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
- fragBuilder->codeAppendf("half4 %s;\n", temp.c_str());
- this->invokeChild(0, args.fInputColor, temp.c_str(), args);
+ this->emitChild(0, args.fInputColor, &temp, args);
SkString input = temp;
for (int i = 1; i < this->numChildProcessors() - 1; ++i) {
temp.printf("out%d", i);
- fragBuilder->codeAppendf("half4 %s;\n", temp.c_str());
- this->invokeChild(i, input.c_str(), temp.c_str(), args);
+ this->emitChild(i, input.c_str(), &temp, args);
input = temp;
}
// Last guy writes to our output variable.
- this->invokeChild(this->numChildProcessors() - 1, input.c_str(),
- args.fOutputColor, args);
+ this->emitChild(this->numChildProcessors() - 1, input.c_str(), args);
}
};
return new GLFP;