Update existing TestCreate methods to honor the inputFP in the TestData.
This can be leveraged to build chains of test FPs in a controlled way.
At present, `inputFP` it is never set to anything other than null; as
such, all calls to TestCreate continue to set a null inputFP
(exactly as they do already).
Change-Id: I0d74f37a076ca338e44ff734816299beb1667c26
Bug: skia:10384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302668
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/generated/GrAARectEffect.cpp b/src/gpu/effects/generated/GrAARectEffect.cpp
index eeabc49..c2797e1 100644
--- a/src/gpu/effects/generated/GrAARectEffect.cpp
+++ b/src/gpu/effects/generated/GrAARectEffect.cpp
@@ -57,13 +57,13 @@
args.fUniformHandler->getUniformCStr(rectUniformVar),
args.fUniformHandler->getUniformCStr(rectUniformVar), (int)_outer.edgeType,
(int)_outer.edgeType);
- SkString _sample1677 = this->invokeChild(0, args);
+ SkString _sample1678 = this->invokeChild(0, args);
fragBuilder->codeAppendf(
R"SkSL(
half4 inputColor = %s;
%s = inputColor * alpha;
)SkSL",
- _sample1677.c_str(), args.fOutputColor);
+ _sample1678.c_str(), args.fOutputColor);
}
private:
@@ -116,13 +116,9 @@
d->fRandom->nextSScalar1(),
d->fRandom->nextSScalar1(),
d->fRandom->nextSScalar1());
- std::unique_ptr<GrFragmentProcessor> fp;
- do {
- GrClipEdgeType edgeType =
- static_cast<GrClipEdgeType>(d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
+ GrClipEdgeType edgeType =
+ static_cast<GrClipEdgeType>(d->fRandom->nextULessThan(kGrClipEdgeTypeCnt));
- fp = GrAARectEffect::Make(/*inputFP=*/nullptr, edgeType, rect);
- } while (nullptr == fp);
- return fp;
+ return GrAARectEffect::Make(d->inputFP(), edgeType, rect);
}
#endif