diff options
author | Robert Phillips <robertphillips@google.com> | 2018-03-14 10:26:57 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-14 15:00:12 +0000 |
commit | e4aae34f4f496f794db89c983bd127339c0fe7e2 (patch) | |
tree | 19a37471c64e8a580120dd6b075cfa85689bb4a3 /include/private/GrSurfaceProxy.h | |
parent | 8a37583af573e7da83d8a07d17fca81caa87123b (diff) |
Provide promise images when rendering SKPs w/ DDL
Change-Id: I8014693eefb3c7811a1fc0354ee8441c90c97328
Reviewed-on: https://skia-review.googlesource.com/113213
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
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; } |