aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawingManager.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-17 14:18:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-18 11:43:17 +0000
commitf5442bb4c152e7c8138c83d27140e55d846f7ea5 (patch)
tree9ff66ac0e928c8cfa325e6bb741cb230ecf584a2 /src/gpu/GrDrawingManager.cpp
parentc1b879f11b937142f5478bd3b416b26be93dea23 (diff)
Split cleanup changes out of bigger CL (take 2)
This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists) This is a reland of: https://skia-review.googlesource.com/c/13585/ (Split cleanup changes out of bigger CL) TBR=bsalomon@google.com Change-Id: Id0d5c764953230412e78ae6aa654f8dfae998c60 Reviewed-on: https://skia-review.googlesource.com/13643 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r--src/gpu/GrDrawingManager.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index cecf52f329..6b2c5a20b4 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -31,7 +31,6 @@ 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();
@@ -86,9 +85,11 @@ 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);
@@ -148,9 +149,6 @@ 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
@@ -206,25 +204,24 @@ 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]);
+ rtp->setLastOpList(fOpLists[0].get());
// 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]);
+ return sk_ref_sp((GrRenderTargetOpList*) fOpLists[0].get());
}
#endif
- GrRenderTargetOpList* opList = new GrRenderTargetOpList(rtp,
- fContext->getGpu(),
- fContext->resourceProvider(),
- fContext->getAuditTrail(),
- fOptionsForOpLists);
- SkASSERT(rtp->getLastOpList() == opList);
+ sk_sp<GrRenderTargetOpList> opList(new GrRenderTargetOpList(rtp,
+ fContext->getGpu(),
+ fContext->resourceProvider(),
+ fContext->getAuditTrail(),
+ fOptionsForOpLists));
+ SkASSERT(rtp->getLastOpList() == opList.get());
- *fOpLists.append() = opList;
+ fOpLists.push_back() = opList;
- // DrawingManager gets the creation ref - this ref is for the caller
- return sk_ref_sp(opList);
+ return opList;
}
sk_sp<GrTextureOpList> GrDrawingManager::newTextureOpList(sk_sp<GrTextureProxy> textureProxy) {