aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgram.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-26 06:55:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-26 06:55:02 -0700
commitb58a2b4919aa67ab5bab1d497f26671d704654b4 (patch)
treebc1f99168fb99c090d0c753d6c8ecbbe0e654772 /src/gpu/gl/GrGLProgram.cpp
parent94d7872ab3b0a32675b8e826637665fd3ada5b35 (diff)
Stop aggregating texture/buffer access objects in GrFragmentProcessor parents.
Diffstat (limited to 'src/gpu/gl/GrGLProgram.cpp')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index f34fce43b4..dd73d01dc1 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -88,10 +88,9 @@ void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline) {
this->generateMipmaps(primProc, pipeline.getAllowSRGBInputs());
- int numProcessors = fFragmentProcessors.count();
- for (int i = 0; i < numProcessors; ++i) {
- const GrFragmentProcessor& processor = pipeline.getFragmentProcessor(i);
- this->generateMipmaps(processor, pipeline.getAllowSRGBInputs());
+ GrFragmentProcessor::Iter iter(pipeline);
+ while (const GrFragmentProcessor* fp = iter.next()) {
+ this->generateMipmaps(*fp, pipeline.getAllowSRGBInputs());
}
if (primProc.getPixelLocalStorageState() !=
@@ -104,12 +103,17 @@ void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,
void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
int* nextSamplerIdx) {
- int numProcessors = fFragmentProcessors.count();
- for (int i = 0; i < numProcessors; ++i) {
- const GrFragmentProcessor& processor = pipeline.getFragmentProcessor(i);
- fFragmentProcessors[i]->setData(fProgramDataManager, processor);
- this->bindTextures(processor, pipeline.getAllowSRGBInputs(), nextSamplerIdx);
+ GrFragmentProcessor::Iter iter(pipeline);
+ GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.begin(),
+ fFragmentProcessors.count());
+ const GrFragmentProcessor* fp = iter.next();
+ GrGLSLFragmentProcessor* glslFP = glslIter.next();
+ while (fp && glslFP) {
+ glslFP->setData(fProgramDataManager, *fp);
+ this->bindTextures(*fp, pipeline.getAllowSRGBInputs(), nextSamplerIdx);
+ fp = iter.next(), glslFP = glslIter.next();
}
+ SkASSERT(!fp && !glslFP);
}