Remove recursion from setData() in GrGLSLFragmentProcessor

Bug: skia:8417
Change-Id: Ida8517b959e7d521ae3ebd002ae84e4c55008ad2
Reviewed-on: https://skia-review.googlesource.com/157423
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2018-09-27 17:31:08 -04:00 committed by Skia Commit-Bot
parent f88f49d2a5
commit d3a357db87
3 changed files with 3 additions and 5 deletions

View File

@ -14,10 +14,6 @@
void GrGLSLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& processor) {
this->onSetData(pdman, processor);
SkASSERT(fChildProcessors.count() == processor.numChildProcessors());
for (int i = 0; i < fChildProcessors.count(); ++i) {
fChildProcessors[i]->setData(pdman, processor.childProcessor(i));
}
}
void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) {

View File

@ -124,6 +124,8 @@ public:
virtual void emitCode(EmitArgs&) = 0;
// This does not recurse to any attached child processors. Recursing the entire processor tree
// is the responsibility of the caller.
void setData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& processor);
int numChildProcessors() const { return fChildProcessors.count(); }

View File

@ -81,7 +81,7 @@ void GrMtlPipelineState::setData(const GrPrimitiveProcessor& primProc,
const GrFragmentProcessor* fp = iter.next();
GrGLSLFragmentProcessor* glslFP = glslIter.next();
while (fp && glslFP) {
glslFP->setData(fDataManager, *fp);
glslFP->setData(fDataManager, *fp);
for (int i = 0; i < fp->numTextureSamplers(); ++i) {
const auto& sampler = fp->textureSampler(i);
fSamplerBindings.emplace_back(sampler.samplerState(), sampler.peekTexture(),