From 4684f82ebca85d4c7043e5c1028e34cf5631da32 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 8 Mar 2018 15:27:36 -0500 Subject: Add ability to uninstantiate lazy proxies after every flush. Bug: skia: Change-Id: Id32540cda54a9c5e3e6cb721776699be3cc8ac1a Reviewed-on: https://skia-review.googlesource.com/113263 Commit-Queue: Greg Daniel Reviewed-by: Brian Salomon Reviewed-by: Robert Phillips --- include/private/GrSurfaceProxy.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index 470ab7de65..d90c408ba6 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -58,7 +58,8 @@ public: #endif void release() { - SkASSERT(1 == fRefCnt); + // The proxy itself may still have multiple refs. It can be owned by an SkImage and multiple + // SkDeferredDisplayLists at the same time if we are using DDLs. SkASSERT(0 == fPendingReads); SkASSERT(0 == fPendingWrites); @@ -194,8 +195,10 @@ private: class GrSurfaceProxy : public GrIORefProxy { public: enum class LazyInstantiationType { - kSingleUse, // Instantiation callback is allowed to be called only once - kMultipleUse, // Instantiation callback can be called multiple times. + kSingleUse, // Instantiation callback is allowed to be called only once + kMultipleUse, // Instantiation callback can be called multiple times. + kUninstantiate, // Instantiation callback can be called multiple times, + // but we will uninstantiate the proxy after every flush }; enum class LazyState { -- cgit v1.2.3