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/GrRRectBlurEffect.cpp b/src/gpu/effects/generated/GrRRectBlurEffect.cpp
index 6ef1e25..a2587e1 100644
--- a/src/gpu/effects/generated/GrRRectBlurEffect.cpp
+++ b/src/gpu/effects/generated/GrRRectBlurEffect.cpp
@@ -95,19 +95,13 @@
args.fUniformHandler->getUniformCStr(blurRadiusVar),
args.fUniformHandler->getUniformCStr(cornerRadiusVar));
SkString _input9600(args.fInputColor);
- SkString _sample9600;
- if (_outer.inputFP_index >= 0) {
- _sample9600 = this->invokeChild(_outer.inputFP_index, _input9600.c_str(), args);
- } else {
- _sample9600.swap(_input9600);
- }
+ SkString _sample9600 = this->invokeChild(0, _input9600.c_str(), args);
fragBuilder->codeAppendf(
R"SkSL(
half4 inputColor = %s;)SkSL",
_sample9600.c_str());
SkString _coords9660("float2(texCoord)");
- SkString _sample9660;
- _sample9660 = this->invokeChild(_outer.ninePatchFP_index, args, _coords9660.c_str());
+ SkString _sample9660 = this->invokeChild(1, args, _coords9660.c_str());
fragBuilder->codeAppendf(
R"SkSL(
%s = inputColor * %s;
@@ -160,13 +154,7 @@
, sigma(src.sigma)
, rect(src.rect)
, cornerRadius(src.cornerRadius) {
- if (src.inputFP_index >= 0) {
- inputFP_index = this->cloneAndRegisterChildProcessor(src.childProcessor(src.inputFP_index));
- }
- {
- ninePatchFP_index =
- this->cloneAndRegisterChildProcessor(src.childProcessor(src.ninePatchFP_index));
- }
+ this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrRRectBlurEffect::clone() const {
return std::unique_ptr<GrFragmentProcessor>(new GrRRectBlurEffect(*this));