In FPs, store pointers for all child slots, even nullptr
This simplifies things like ConstantOutputForConstantInput and
invokeChild. It also removes the need for child indices: generated
FPs now directly refer to their children by slot number.
Change-Id: I69bbb042d5d72d21b999256f969c467702d0774d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302436
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp b/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
index 915479c..b765e33 100644
--- a/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
+++ b/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
@@ -25,9 +25,7 @@
(void)_outer;
SkString _input203(args.fInputColor);
SkString _coords203("sk_FragCoord.xy");
- SkString _sample203;
- _sample203 =
- this->invokeChild(_outer.fp_index, _input203.c_str(), args, _coords203.c_str());
+ SkString _sample203 = this->invokeChild(0, _input203.c_str(), args, _coords203.c_str());
fragBuilder->codeAppendf(
R"SkSL(%s = %s;
)SkSL",
@@ -50,7 +48,7 @@
}
GrDeviceSpaceEffect::GrDeviceSpaceEffect(const GrDeviceSpaceEffect& src)
: INHERITED(kGrDeviceSpaceEffect_ClassID, src.optimizationFlags()) {
- { fp_index = this->cloneAndRegisterChildProcessor(src.childProcessor(src.fp_index)); }
+ this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrDeviceSpaceEffect::clone() const {
return std::unique_ptr<GrFragmentProcessor>(new GrDeviceSpaceEffect(*this));