Remove generic GrFragmentProcessor texture sampling.
Instead GrTextureEffect is a special effect known by
program builders, pipeline states, etc.
Change-Id: I4436d7a10a1c3174fe1f02f136363a1c117f92fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301357
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index ee19309..d97173d 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -140,14 +140,12 @@
}
int nextTexSamplerIdx = primProc.numTextureSamplers();
- GrFragmentProcessor::CIter fpIter(pipeline);
- for (; fpIter; ++fpIter) {
- for (int i = 0; i < fpIter->numTextureSamplers(); ++i) {
- const GrFragmentProcessor::TextureSampler& sampler = fpIter->textureSampler(i);
- fGpu->bindTexture(nextTexSamplerIdx++, sampler.samplerState(), sampler.view().swizzle(),
- static_cast<GrGLTexture*>(sampler.peekTexture()));
- }
- }
+ pipeline.visitTextureEffects([&](const GrTextureEffect& te) {
+ GrSamplerState samplerState = te.samplerState();
+ GrSwizzle swizzle = te.view().swizzle();
+ auto* texture = static_cast<GrGLTexture*>(te.texture());
+ fGpu->bindTexture(nextTexSamplerIdx++, samplerState, swizzle, texture);
+ });
SkIPoint offset;
GrTexture* dstTexture = pipeline.peekDstTexture(&offset);