From 4a395049a977d7e04515bad490365fe9ec9ffaab Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 24 Apr 2017 16:27:17 +0000 Subject: 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 > Commit-Queue: Robert Phillips > 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 Commit-Queue: Robert Phillips --- src/gpu/GrSurfaceProxy.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/gpu/GrSurfaceProxy.cpp') 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 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() { -- cgit v1.2.3