Make fragment processor iterators work with range for loops.
When iterating over the coord transforms or texture samplers of a
FP also have access to the owning FP.
Pass a coord transform range to GPs rather than a pointer to an
iterator.
Change-Id: If7c829a67dce6600d7f49e12d6f49f685dcace3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256216
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index e75ac06..f653542 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -111,3 +111,14 @@
b->add32(blendKey);
}
+
+void GrPipeline::visitProxies(const GrOp::VisitProxyFunc& func) const {
+ // This iteration includes any clip coverage FPs
+ for (auto [sampler, fp] : GrFragmentProcessor::PipelineTextureSamplerRange(*this)) {
+ bool mipped = (GrSamplerState::Filter::kMipMap == sampler.samplerState().filter());
+ func(sampler.proxy(), GrMipMapped(mipped));
+ }
+ if (fDstProxyView.asTextureProxy()) {
+ func(fDstProxyView.asTextureProxy(), GrMipMapped::kNo);
+ }
+}