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/GrProgramInfo.cpp b/src/gpu/GrProgramInfo.cpp
index 43b307a..34e6459 100644
--- a/src/gpu/GrProgramInfo.cpp
+++ b/src/gpu/GrProgramInfo.cpp
@@ -31,25 +31,26 @@
}
void GrProgramInfo::checkAllInstantiated() const {
- for (auto [sampler, fp] : GrFragmentProcessor::PipelineTextureSamplerRange(this->pipeline())) {
- SkASSERT(sampler.proxy()->isInstantiated());
- }
+ this->pipeline().visitProxies([](GrSurfaceProxy* proxy, GrMipMapped) {
+ SkASSERT(proxy->isInstantiated());
+ return true;
+ });
}
void GrProgramInfo::checkMSAAAndMIPSAreResolved() const {
- for (auto [sampler, fp] : GrFragmentProcessor::PipelineTextureSamplerRange(this->pipeline())) {
- GrTexture* tex = sampler.peekTexture();
+ this->pipeline().visitTextureEffects([](const GrTextureEffect& te) {
+ GrTexture* tex = te.texture();
SkASSERT(tex);
// Ensure mipmaps were all resolved ahead of time by the DAG.
- if (GrSamplerState::Filter::kMipMap == sampler.samplerState().filter() &&
+ if (GrSamplerState::Filter::kMipMap == te.samplerState().filter() &&
(tex->width() != 1 || tex->height() != 1)) {
- // There are some cases where we might be given a non-mipmapped texture with a mipmap
- // filter. See skbug.com/7094.
+ // There are some cases where we might be given a non-mipmapped texture with a
+ // mipmap filter. See skbug.com/7094.
SkASSERT(tex->texturePriv().mipMapped() != GrMipMapped::kYes ||
!tex->texturePriv().mipMapsAreDirty());
}
- }
+ });
}
#endif