Have visitProxies take a GrTexutreProxy instead of GrSurfaceProxy.

Change-Id: Ic1508d7909c90298fdb906391f981505c3ed497e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237485
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2019-08-27 14:30:21 -04:00 committed by Skia Commit-Bot
parent 977b50a7e0
commit dcf9ca1820
8 changed files with 19 additions and 13 deletions

View File

@ -37,7 +37,7 @@ private:
bool onExecute(GrOpFlushState*) override;
#ifdef SK_DEBUG
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {
void visitProxies_debugOnly(const VisitSurfaceProxyFunc& fn) const override {
fn(fSrcProxy.get(), GrMipMapped::kNo);
}
#endif

View File

@ -576,9 +576,13 @@ void GrOpsTask::dump(bool printDependencies) const {
}
}
void GrOpsTask::visitProxies_debugOnly(const GrOp::VisitProxyFunc& func) const {
void GrOpsTask::visitProxies_debugOnly(const VisitSurfaceProxyFunc& func) const {
auto textureFunc = [ func ] (GrTextureProxy* tex, GrMipMapped mipmapped) {
func(tex, mipmapped);
};
for (const OpChain& chain : fOpChains) {
chain.visitProxies(func);
chain.visitProxies(textureFunc);
}
}

View File

@ -60,7 +60,7 @@ public:
void addOp(std::unique_ptr<GrOp> op, GrTextureResolveManager textureResolveManager,
const GrCaps& caps) {
auto addDependency = [ textureResolveManager, &caps, this ] (
GrSurfaceProxy* p, GrMipMapped mipmapped) {
GrTextureProxy* p, GrMipMapped mipmapped) {
this->addDependency(p, mipmapped, textureResolveManager, caps);
};
@ -79,7 +79,7 @@ public:
GrAppliedClip&& clip, const DstProxy& dstProxy,
GrTextureResolveManager textureResolveManager, const GrCaps& caps) {
auto addDependency = [ textureResolveManager, &caps, this ] (
GrSurfaceProxy* p, GrMipMapped mipmapped) {
GrTextureProxy* p, GrMipMapped mipmapped) {
this->addDependency(p, mipmapped, textureResolveManager, caps);
};
@ -97,7 +97,7 @@ public:
SkDEBUGCODE(void dump(bool printDependencies) const override;)
SkDEBUGCODE(int numClips() const override { return fNumClips; })
SkDEBUGCODE(void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;)
SkDEBUGCODE(void visitProxies_debugOnly(const VisitSurfaceProxyFunc&) const override;)
private:
bool isNoOp() const {

View File

@ -65,9 +65,11 @@ public:
virtual int numClips() const { return 0; }
virtual void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const = 0;
using VisitSurfaceProxyFunc = std::function<void(GrSurfaceProxy*, GrMipMapped)>;
void visitTargetAndSrcProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const {
virtual void visitProxies_debugOnly(const VisitSurfaceProxyFunc&) const = 0;
void visitTargetAndSrcProxies_debugOnly(const VisitSurfaceProxyFunc& fn) const {
this->visitProxies_debugOnly(fn);
fn(fTarget.get(), GrMipMapped::kNo);
}

View File

@ -37,7 +37,7 @@ private:
#ifdef SK_DEBUG
// No non-dst proxies.
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {}
void visitProxies_debugOnly(const VisitSurfaceProxyFunc& fn) const override {}
#endif
const GrTextureResolveFlags fResolveFlags;

View File

@ -43,7 +43,7 @@ private:
bool onExecute(GrOpFlushState*) override;
#ifdef SK_DEBUG
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {
void visitProxies_debugOnly(const VisitSurfaceProxyFunc& fn) const override {
fn(fSrcProxy.get(), GrMipMapped::kNo);
}
#endif

View File

@ -68,7 +68,7 @@ public:
virtual const char* name() const = 0;
using VisitProxyFunc = std::function<void(GrSurfaceProxy*, GrMipMapped)>;
using VisitProxyFunc = std::function<void(GrTextureProxy*, GrMipMapped)>;
virtual void visitProxies(const VisitProxyFunc&) const {
// This default implementation assumes the op has no proxies

View File

@ -362,7 +362,7 @@ private:
}
int* fTestExecuteValue;
sk_sp<GrSurfaceProxy> fLazyProxy;
sk_sp<GrTextureProxy> fLazyProxy;
typedef GrDrawOp INHERITED;
};
@ -425,7 +425,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override {}
sk_sp<GrSurfaceProxy> fLazyProxy;
sk_sp<GrTextureProxy> fLazyProxy;
typedef GrDrawOp INHERITED;
};