diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-30 13:47:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-31 17:00:22 +0000 |
commit | 5efd5ea4e146c47394d16c8b6f876264822a0bee (patch) | |
tree | 81bff3047ae76431524c75bd9d351171b5fe50e5 /src/gpu/GrOpList.cpp | |
parent | bef2852a8ca0c2dccd9500857a03208d39e3d4f7 (diff) |
Update clearOp for split-OpList world (take 3)
It would reduce a lot of noise if the GrRenderTargetOpList kept a pointer to the GrCaps but, for now, I'm trying to shrink the GrRTOpList, not expand it.
Reland of: https://skia-review.googlesource.com/c/17323/ (Update clearOp for split-OpList world)
Change-Id: Ia61ce4d6ce245380fc9651928a46c22039fc12cf
Reviewed-on: https://skia-review.googlesource.com/18026
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrOpList.cpp')
-rw-r--r-- | src/gpu/GrOpList.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp index 2af34a552b..5160be16c2 100644 --- a/src/gpu/GrOpList.cpp +++ b/src/gpu/GrOpList.cpp @@ -6,6 +6,8 @@ */ #include "GrOpList.h" + +#include "GrContext.h" #include "GrSurfaceProxy.h" #include "SkAtomics.h" @@ -20,17 +22,31 @@ uint32_t GrOpList::CreateUniqueID() { return id; } -GrOpList::GrOpList(GrSurfaceProxy* surfaceProxy, GrAuditTrail* auditTrail) +GrOpList::GrOpList(GrResourceProvider* resourceProvider, + GrSurfaceProxy* surfaceProxy, GrAuditTrail* auditTrail) : fAuditTrail(auditTrail) , fUniqueID(CreateUniqueID()) , fFlags(0) { - fTarget.reset(surfaceProxy); + fTarget.setProxy(sk_ref_sp(surfaceProxy), kWrite_GrIOType); fTarget.get()->setLastOpList(this); + + // MDB TODO: remove this! We are currently moving to having all the ops that target + // the RT as a dest (e.g., clear, etc.) rely on the opList's 'fTarget' pointer + // for the IO Ref. This works well but until they are all swapped over (and none + // are pre-emptively instantiating proxies themselves) we need to instantiate + // here so that the GrSurfaces are created in an order that preserves the GrSurface + // re-use assumptions. + fTarget.get()->instantiate(resourceProvider); + fTarget.markPendingIO(); } GrOpList::~GrOpList() { - if (fTarget.get() && this == fTarget.get()->getLastOpList()) { - fTarget.get()->setLastOpList(nullptr); + if (fTarget.get()) { + if (this == fTarget.get()->getLastOpList()) { + fTarget.get()->setLastOpList(nullptr); + } + + fTarget.pendingIOComplete(); } } @@ -43,7 +59,8 @@ void GrOpList::reset() { fTarget.get()->setLastOpList(nullptr); } - fTarget.reset(nullptr); + fTarget.pendingIOComplete(); + fTarget.reset(); fAuditTrail = nullptr; } |