Index: include/gpu/GrProgramElement.h |
diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h |
index e788486b5cc74d0d4c898268d7754d3e3628b3ac..c71e2074fc41a9cf2c94d517a1142aa2f96a9959 100644 |
--- a/include/gpu/GrProgramElement.h |
+++ b/include/gpu/GrProgramElement.h |
@@ -44,6 +44,7 @@ public: |
this->validate(); |
--fRefCnt; |
if (0 == fRefCnt) { |
+ this->notifyRefCntIsZero(); |
if (0 == fPendingExecutions) { |
delete this; |
return; |
@@ -78,9 +79,6 @@ protected: |
fGpuResources.push_back(res); |
} |
-private: |
- static uint32_t CreateUniqueID(); |
- |
void addPendingExecution() const { |
this->validate(); |
SkASSERT(fRefCnt > 0); |
@@ -105,6 +103,13 @@ private: |
this->validate(); |
} |
+private: |
+ /** This will be called when the ref cnt is zero. The object may or may not have pending |
+ executions. */ |
+ virtual void notifyRefCntIsZero() const = 0; |
+ |
+ static uint32_t CreateUniqueID(); |
+ |
void removeRefs() const; |
void addPendingIOs() const; |
void pendingIOComplete() const; |