diff options
author | 2017-09-14 12:45:25 -0400 | |
---|---|---|
committer | 2017-09-14 18:42:51 +0000 | |
commit | d375dbf1557de71ce8e348e6002463f076cc3967 (patch) | |
tree | 7987175183702bb5e8839c272bc4fca37932af02 /src/gpu/GrTextureOpList.cpp | |
parent | d27392f8a43c5efe2fdb40387aa5c03e611dbea4 (diff) |
Land scaffolding for explicit MDB resource allocation
Change-Id: I1cb30b50068e99181788181683e82e2421d0038a
Reviewed-on: https://skia-review.googlesource.com/46701
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureOpList.cpp')
-rw-r--r-- | src/gpu/GrTextureOpList.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp index e5fbb20bf2..97371d598f 100644 --- a/src/gpu/GrTextureOpList.cpp +++ b/src/gpu/GrTextureOpList.cpp @@ -9,6 +9,7 @@ #include "GrAuditTrail.h" #include "GrGpu.h" +#include "GrResourceAllocator.h" #include "GrTextureProxy.h" #include "SkStringUtils.h" #include "ops/GrCopySurfaceOp.h" @@ -108,6 +109,25 @@ bool GrTextureOpList::copySurface(const GrCaps& caps, return true; } +void GrTextureOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const { + unsigned int cur = alloc->numOps(); + + // Add the interval for all the writes to this opList's target + alloc->addInterval(fTarget.get(), cur, cur+fRecordedOps.count()-1); + + auto gather = [ alloc ] (GrSurfaceProxy* p) { + alloc->addInterval(p); + }; + for (int i = 0; i < fRecordedOps.count(); ++i) { + SkASSERT(alloc->curOp() == cur+i); + + const GrOp* op = fRecordedOps[i].get(); // only diff from the GrRenderTargetOpList version + op->visitProxies(gather); + + alloc->incOps(); + } +} + void GrTextureOpList::recordOp(std::unique_ptr<GrOp> op) { SkASSERT(fTarget.get()); // A closed GrOpList should never receive new/more ops |