aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp2
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp7
-rw-r--r--src/gpu/GrRenderTargetOpList.h13
-rw-r--r--src/gpu/GrResourceAllocator.cpp9
-rw-r--r--src/gpu/GrResourceAllocator.h5
-rw-r--r--src/gpu/GrSurfaceProxyPriv.h5
6 files changed, 8 insertions, 33 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index dc37c27c48..2310ebda94 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1833,8 +1833,6 @@ bool GrRenderTargetContext::setupDstProxy(GrRenderTargetProxy* rtProxy, const Gr
// will be responsible to detect this situation and request a texture barrier.
dstProxy->setProxy(sk_ref_sp(texProxy));
dstProxy->setOffset(0, 0);
- // Notify the resource allocator that this will be a direct read from the render target.
- SkDEBUGCODE(dstProxy->proxy()->priv().markAsDirectDstRead_debugOnly();)
return true;
}
}
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 6ec8496536..4bdfe589bb 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -274,8 +274,11 @@ void GrRenderTargetOpList::gatherProxyIntervals(GrResourceAllocator* alloc) cons
auto gather = [ alloc ] (GrSurfaceProxy* p) {
alloc->addInterval(p);
};
- for (const RecordedOp& recordedOp : fRecordedOps) {
- recordedOp.visitProxies(gather); // only diff from the GrTextureOpList version
+ for (int i = 0; i < fRecordedOps.count(); ++i) {
+ const GrOp* op = fRecordedOps[i].fOp.get(); // only diff from the GrTextureOpList version
+ if (op) {
+ op->visitProxies(gather);
+ }
// Even though the op may have been moved we still need to increment the op count to
// keep all the math consistent.
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 7e600d41d1..e9797db8f5 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -136,19 +136,6 @@ private:
fDstProxy = *dstProxy;
}
}
-
- void visitProxies(const GrOp::VisitProxyFunc& func) const {
- if (fOp) {
- fOp->visitProxies(func);
- }
- if (fDstProxy.proxy()) {
- func(fDstProxy.proxy());
- }
- if (fAppliedClip) {
- fAppliedClip->visitProxies(func);
- }
- }
-
std::unique_ptr<GrOp> fOp;
DstProxy fDstProxy;
GrAppliedClip* fAppliedClip;
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index 11fa7ea7ea..5cb882f61c 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -50,14 +50,7 @@ void GrResourceAllocator::addInterval(GrSurfaceProxy* proxy,
if (Interval* intvl = fIntvlHash.find(proxy->uniqueID().asUInt())) {
// Revise the interval for an existing use
-#ifdef SK_DEBUG
- if (proxy->priv().isDirectDstRead_debugOnly()) {
- // Direct reads from the render target itself should occur w/in the existing interval
- SkASSERT(intvl->start() <= start && intvl->end() >= end);
- } else {
- SkASSERT(intvl->end() <= start && intvl->end() <= end);
- }
-#endif
+ SkASSERT(intvl->end() <= start && intvl->end() <= end);
intvl->extendEnd(end);
return;
}
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index dde7519392..f576649030 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -120,9 +120,8 @@ private:
void setNext(Interval* next) { fNext = next; }
void extendEnd(unsigned int newEnd) {
- if (newEnd > fEnd) {
- fEnd = newEnd;
- }
+ SkASSERT(newEnd >= fEnd);
+ fEnd = newEnd;
}
void assign(sk_sp<GrSurface>);
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
index 0e059722ec..a93a20c051 100644
--- a/src/gpu/GrSurfaceProxyPriv.h
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -70,11 +70,6 @@ public:
static bool AttachStencilIfNeeded(GrResourceProvider*, GrSurface*, bool needsStencil);
- // These are used to notify the resource allocator when a proxy is a direct read from the render
- // target itself (via texture barrier). This information is necessary for certain assertions.
- SkDEBUGCODE(void markAsDirectDstRead_debugOnly() { fProxy->fIsDirectDstRead = true; })
- SkDEBUGCODE(bool isDirectDstRead_debugOnly() const { return fProxy->fIsDirectDstRead; })
-
private:
explicit GrSurfaceProxyPriv(GrSurfaceProxy* proxy) : fProxy(proxy) {}
GrSurfaceProxyPriv(const GrSurfaceProxyPriv&) {} // unimpl