aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/private/GrSurfaceProxy.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index cb8c46e78f..6beb11e46f 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -57,6 +57,17 @@ public:
}
#endif
+ void release() {
+ SkASSERT(1 == fRefCnt);
+ SkASSERT(0 == fPendingReads);
+ SkASSERT(0 == fPendingWrites);
+
+ SkASSERT(fTarget->internalHasUniqueRef());
+ SkASSERT(!fTarget->internalHasPendingIO());
+ fTarget->unref();
+ fTarget = nullptr;
+ }
+
void validate() const {
#ifdef SK_DEBUG
SkASSERT(fRefCnt >= 0);
@@ -129,7 +140,7 @@ protected:
}
virtual ~GrIORefProxy() {
// We don't unref 'fTarget' here since the 'unref' method will already
- // have forwarded on the unref call that got use here.
+ // have forwarded on the unref call that got us here.
}
// This GrIORefProxy was deferred before but has just been instantiated. To
@@ -279,6 +290,8 @@ public:
virtual bool instantiate(GrResourceProvider* resourceProvider) = 0;
+ void deInstantiate();
+
/**
* Helper that gets the width and height of the surface as a bounding rectangle.
*/