Add onPrePrepare to GrFillRRectOp
As the first real op to be updated this required the plumbing of the DstProxyView and the de-constification of the GrAppliedClip.
Bug: skia:9455
Change-Id: Ieaa16adfa1d114021b2ad60d0ef8ecbe31d9cc82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255136
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 7854e82..537293bb 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -192,7 +192,20 @@
bool isStencilEnabled() const {
return SkToBool(fFlags & Flags::kStencilEnabled);
}
- SkDEBUGCODE(bool isBad() const { return SkToBool(fFlags & Flags::kIsBad); })
+#ifdef SK_DEBUG
+ bool allProxiesInstantiated() const {
+ for (int i = 0; i < fFragmentProcessors.count(); ++i) {
+ if (!fFragmentProcessors[i]->isInstantiated()) {
+ return false;
+ }
+ }
+ if (fDstProxyView.proxy()) {
+ return fDstProxyView.proxy()->isInstantiated();
+ }
+
+ return true;
+ }
+#endif
GrXferBarrierType xferBarrierType(GrTexture*, const GrCaps&) const;
@@ -201,10 +214,21 @@
const GrSwizzle& outputSwizzle() const { return fOutputSwizzle; }
+ void visitProxies(const GrOp::VisitProxyFunc& func) const {
+ // This iteration includes any clip coverage FPs
+ for (int i = 0; i < this->numFragmentProcessors(); ++i) {
+ GrFragmentProcessor::TextureAccessIter iter(fFragmentProcessors[i].get());
+ while (const GrFragmentProcessor::TextureSampler* sampler = iter.next()) {
+ bool mipped = (GrSamplerState::Filter::kMipMap == sampler->samplerState().filter());
+ func(sampler->proxy(), GrMipMapped(mipped));
+ }
+ }
+ if (fDstProxyView.asTextureProxy()) {
+ func(fDstProxyView.asTextureProxy(), GrMipMapped::kNo);
+ }
+ }
+
private:
-
- SkDEBUGCODE(void markAsBad() { fFlags |= Flags::kIsBad; })
-
static constexpr uint8_t kLastInputFlag = (uint8_t)InputFlags::kSnapVerticesToPixelCenters;
/** This is a continuation of the public "InputFlags" enum. */
@@ -212,9 +236,6 @@
kHasStencilClip = (kLastInputFlag << 1),
kStencilEnabled = (kLastInputFlag << 2),
kScissorEnabled = (kLastInputFlag << 3),
-#ifdef SK_DEBUG
- kIsBad = (kLastInputFlag << 4),
-#endif
};
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags);