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/GrConfigConversionEffect.cpp b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
index 9f3422a..1ad460d 100644
--- a/src/gpu/effects/generated/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
@@ -27,8 +27,7 @@
(void)pmConversion;
fragBuilder->forceHighPrecision();
- SkString _sample5730;
- _sample5730 = this->invokeChild(_outer.inputFP_index, args);
+ SkString _sample5730 = this->invokeChild(0, args);
fragBuilder->codeAppendf(
R"SkSL(%s = floor(%s * 255.0 + 0.5) / 255.0;
@switch (%d) {
@@ -65,7 +64,7 @@
GrConfigConversionEffect::GrConfigConversionEffect(const GrConfigConversionEffect& src)
: INHERITED(kGrConfigConversionEffect_ClassID, src.optimizationFlags())
, pmConversion(src.pmConversion) {
- { inputFP_index = this->cloneAndRegisterChildProcessor(src.childProcessor(src.inputFP_index)); }
+ this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrConfigConversionEffect::clone() const {
return std::unique_ptr<GrFragmentProcessor>(new GrConfigConversionEffect(*this));