Index: src/gpu/GrGpuResourceCacheAccess.h |
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h |
index 7417a55a718bcadfefac8a6a084431ace8c9f98e..3c3786d05359086954c0e23c6cc478b58987c208 100644 |
--- a/src/gpu/GrGpuResourceCacheAccess.h |
+++ b/src/gpu/GrGpuResourceCacheAccess.h |
@@ -54,6 +54,26 @@ public: |
return NULL; |
} |
+ /** |
+ * Called by the cache to delete the resource under normal circumstances. |
+ */ |
+ void release() { |
+ fResource->release(); |
+ if (fResource->isPurgable()) { |
+ SkDELETE(fResource); |
+ } |
+ } |
+ |
+ /** |
+ * Called by the cache to delete the resource when the backend 3D context is no longer valid. |
+ */ |
+ void abandon() { |
+ fResource->abandon(); |
+ if (fResource->isPurgable()) { |
+ SkDELETE(fResource); |
+ } |
+ } |
+ |
private: |
CacheAccess(GrGpuResource* resource) : fResource(resource) { } |
CacheAccess(const CacheAccess& that) : fResource(that.fResource) { } |