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/GrDitherEffect.cpp b/src/gpu/effects/generated/GrDitherEffect.cpp
index 6bdb808..643ef17 100644
--- a/src/gpu/effects/generated/GrDitherEffect.cpp
+++ b/src/gpu/effects/generated/GrDitherEffect.cpp
@@ -28,8 +28,7 @@
rangeVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kHalf_GrSLType,
"range");
SkString _input302(args.fInputColor);
- SkString _sample302;
- _sample302 = this->invokeChild(_outer.inputFP_index, _input302.c_str(), args);
+ SkString _sample302 = this->invokeChild(0, _input302.c_str(), args);
fragBuilder->codeAppendf(
R"SkSL(half4 color = %s;
half value;
@@ -71,7 +70,7 @@
}
GrDitherEffect::GrDitherEffect(const GrDitherEffect& src)
: INHERITED(kGrDitherEffect_ClassID, src.optimizationFlags()), range(src.range) {
- { inputFP_index = this->cloneAndRegisterChildProcessor(src.childProcessor(src.inputFP_index)); }
+ this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrDitherEffect::clone() const {
return std::unique_ptr<GrFragmentProcessor>(new GrDitherEffect(*this));