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/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index 285bb3c..fcd9196 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -203,17 +203,20 @@
if (fRecordedOps.count()) {
unsigned int cur = alloc->curOp();
- alloc->addInterval(fTarget.get(), cur, cur+fRecordedOps.count()-1);
+ alloc->addInterval(fTarget.get(), cur, cur+fRecordedOps.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(, p == fTarget.get()));
+ alloc->addInterval(p, alloc->curOp(), alloc->curOp(), GrResourceAllocator::ActualUse::kYes
+ SkDEBUGCODE(, p == fTarget.get()));
};
for (int i = 0; i < fRecordedOps.count(); ++i) {
const GrOp* op = fRecordedOps[i].get(); // only diff from the GrRenderTargetOpList version