Implement alternate method for determining recycle-ability of allocated GrSurfaces (take 2)
With the upcoming removal of pendingIO refs the GrResourceAllocator needs a new means of determining when a backing GrSurface can be recycled and when it needs to be left assigned to a GrSurfaceProxy.
Change-Id: I2327b0f15ceb639b400a55a9c53359a4b43288c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210041
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index e652902..f586293 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -633,24 +633,27 @@
// they can be recycled. This is a bit unfortunate because a flush can proceed in waves
// with sub-flushes. The deferred proxies only need to be pinned from the start of
// the sub-flush in which they appear.
- alloc->addInterval(fDeferredProxies[i], 0, 0);
+ alloc->addInterval(fDeferredProxies[i], 0, 0, GrResourceAllocator::ActualUse::kNo);
}
// Add the interval for all the writes to this opList's target
if (fOpChains.count()) {
unsigned int cur = alloc->curOp();
- alloc->addInterval(fTarget.get(), cur, cur + fOpChains.count() - 1);
+ alloc->addInterval(fTarget.get(), cur, cur + fOpChains.count() - 1,
+ GrResourceAllocator::ActualUse::kYes);
} else {
// This can happen if there is a loadOp (e.g., a clear) but no other draws. In this case we
// still need to add an interval for the destination so we create a fake op# for
// the missing clear op.
- alloc->addInterval(fTarget.get(), alloc->curOp(), alloc->curOp());
+ alloc->addInterval(fTarget.get(), alloc->curOp(), alloc->curOp(),
+ GrResourceAllocator::ActualUse::kYes);
alloc->incOps();
}
auto gather = [ alloc SkDEBUGCODE(, this) ] (GrSurfaceProxy* p) {
- alloc->addInterval(p, alloc->curOp(), alloc->curOp() SkDEBUGCODE(, fTarget.get() == p));
+ alloc->addInterval(p, alloc->curOp(), alloc->curOp(), GrResourceAllocator::ActualUse::kYes
+ SkDEBUGCODE(, fTarget.get() == p));
};
for (const OpChain& recordedOp : fOpChains) {
// only diff from the GrTextureOpList version