aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxy.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-24 16:27:17 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-24 16:27:23 +0000
commit4a395049a977d7e04515bad490365fe9ec9ffaab (patch)
treeefb32997bbe5376eb40dffa5a59d85a7e2c9b0c2 /src/gpu/GrSurfaceProxy.cpp
parent3e38d8205fc743ca956a265a3965ede2897b040a (diff)
Revert "Split up opLists (take 2)"
This reverts commit df2bf213649e0b2bcb9402548af9976bbdf7a218. Reason for revert: Maybe AndroidOne timing out Original change's description: > Split up opLists (take 2) > > Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists) > > https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt. > > Change-Id: Icc9998196587510328e0a9ca1b2ce42013a86c6c > Reviewed-on: https://skia-review.googlesource.com/13802 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I744f2a3145b294e5911862bb39d57ca33a1b9a5a Reviewed-on: https://skia-review.googlesource.com/14184 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 8451409eae..b55d12a124 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -32,9 +32,10 @@ GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, SkBackingFit fit)
}
GrSurfaceProxy::~GrSurfaceProxy() {
- // For this to be deleted the opList that held a ref on it (if there was one) must have been
- // deleted. Which would have cleared out this back pointer.
- SkASSERT(!fLastOpList);
+ if (fLastOpList) {
+ fLastOpList->clearTarget();
+ }
+ SkSafeUnref(fLastOpList);
}
GrSurface* GrSurfaceProxy::instantiate(GrResourceProvider* resourceProvider) {
@@ -96,14 +97,15 @@ int GrSurfaceProxy::worstCaseHeight(const GrCaps& caps) const {
}
void GrSurfaceProxy::setLastOpList(GrOpList* opList) {
-#ifdef SK_DEBUG
if (fLastOpList) {
+ // The non-MDB world never closes so we can't check this condition
+#ifdef ENABLE_MDB
SkASSERT(fLastOpList->isClosed());
- }
#endif
+ fLastOpList->clearTarget();
+ }
- // Un-reffed
- fLastOpList = opList;
+ SkRefCnt_SafeAssign(fLastOpList, opList);
}
GrRenderTargetOpList* GrSurfaceProxy::getLastRenderTargetOpList() {