diff options
Diffstat (limited to 'include/private/GrSurfaceProxy.h')
-rw-r--r-- | include/private/GrSurfaceProxy.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index d90c408ba6..deac90002e 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -63,9 +63,16 @@ public: SkASSERT(0 == fPendingReads); SkASSERT(0 == fPendingWrites); - SkASSERT(fTarget->internalHasUniqueRef()); + SkASSERT(fRefCnt == fTarget->fRefCnt); SkASSERT(!fTarget->internalHasPendingIO()); - fTarget->unref(); + // In the current hybrid world, the proxy and backing surface are ref/unreffed in + // synchrony. In this instance we're deInstantiating the proxy so, regardless of the + // number of refs on the backing surface, we're going to remove it. If/when the proxy + // is re-instantiated all the refs on the proxy (presumably due to multiple uses in ops) + // will be transfered to the new surface. + for (int refs = fTarget->fRefCnt; refs; --refs) { + fTarget->unref(); + } fTarget = nullptr; } |