diff options
author | Mike Klein <mtklein@google.com> | 2017-04-17 18:04:41 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-17 18:04:46 +0000 |
commit | e186cfd15f2df43415ae024185bdcf5baa955ec9 (patch) | |
tree | a595d33b0925711ac5189ecaceb9eb7e015d5e54 /src/gpu/GrDrawingManager.cpp | |
parent | 215989330c1895a8bd4c00ba767dae6cc79b17ba (diff) |
Revert "Split cleanup changes out of bigger CL"
This reverts commit cd11c809f206af0da3ce1779dee3c91193baa7b0.
Reason for revert: assert(rtp->getLastOpList())
Original change's description:
> Split cleanup changes out of bigger CL
>
> This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)
>
> TBR=bsalomon@google.com
>
> Change-Id: I1239e806a30a93d3c17ad933f118b98a5077dd3a
> Reviewed-on: https://skia-review.googlesource.com/13585
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ia3ef7322fe830a6a4dc29226ce931d35d181c6e0
Reviewed-on: https://skia-review.googlesource.com/13641
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r-- | src/gpu/GrDrawingManager.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 6b2c5a20b4..cecf52f329 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -31,6 +31,7 @@ void GrDrawingManager::cleanup() { // We shouldn't need to do this, but it turns out some clients still hold onto opLists // after a cleanup fOpLists[i]->reset(); + fOpLists[i]->unref(); } fOpLists.reset(); @@ -85,11 +86,9 @@ void GrDrawingManager::internalFlush(GrSurfaceProxy*, GrResourceCache::FlushType fOpLists[i]->makeClosed(); } -#ifdef ENABLE_MDB SkDEBUGCODE(bool result =) SkTTopoSort<GrOpList, GrOpList::TopoSortTraits>(&fOpLists); SkASSERT(result); -#endif GrPreFlushResourceProvider preFlushProvider(this); @@ -149,6 +148,9 @@ void GrDrawingManager::internalFlush(GrSurfaceProxy*, GrResourceCache::FlushType for (int i = 0; i < fOpLists.count(); ++i) { fOpLists[i]->reset(); +#ifdef ENABLE_MDB + fOpLists[i]->unref(); +#endif } #ifndef ENABLE_MDB @@ -204,24 +206,25 @@ sk_sp<GrRenderTargetOpList> GrDrawingManager::newRTOpList(sk_sp<GrRenderTargetPr SkASSERT(fOpLists.count() == 1); // In the non-MDB-world the same GrOpList gets reused for multiple render targets. // Update this pointer so all the asserts are happy - rtp->setLastOpList(fOpLists[0].get()); + rtp->setLastOpList(fOpLists[0]); // DrawingManager gets the creation ref - this ref is for the caller // TODO: although this is true right now it isn't cool - return sk_ref_sp((GrRenderTargetOpList*) fOpLists[0].get()); + return sk_ref_sp((GrRenderTargetOpList*) fOpLists[0]); } #endif - sk_sp<GrRenderTargetOpList> opList(new GrRenderTargetOpList(rtp, - fContext->getGpu(), - fContext->resourceProvider(), - fContext->getAuditTrail(), - fOptionsForOpLists)); - SkASSERT(rtp->getLastOpList() == opList.get()); + GrRenderTargetOpList* opList = new GrRenderTargetOpList(rtp, + fContext->getGpu(), + fContext->resourceProvider(), + fContext->getAuditTrail(), + fOptionsForOpLists); + SkASSERT(rtp->getLastOpList() == opList); - fOpLists.push_back() = opList; + *fOpLists.append() = opList; - return opList; + // DrawingManager gets the creation ref - this ref is for the caller + return sk_ref_sp(opList); } sk_sp<GrTextureOpList> GrDrawingManager::newTextureOpList(sk_sp<GrTextureProxy> textureProxy) { |