Index: src/gpu/GrProgramElement.cpp |
diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp |
index e14a85b5f4c763f46a09470dd810ff06b4d6f921..70d5339e902e81a5baf5d8a84dd1af96824dc507 100644 |
--- a/src/gpu/GrProgramElement.cpp |
+++ b/src/gpu/GrProgramElement.cpp |
@@ -5,7 +5,6 @@ |
* found in the LICENSE file. |
*/ |
- |
#include "GrProgramElement.h" |
#include "GrProgramResource.h" |
@@ -28,3 +27,20 @@ void GrProgramElement::convertRefToPendingExecution() const { |
} |
} |
} |
+ |
+void GrProgramElement::completedExecution() const { |
+ this->validate(); |
+ --fPendingExecutions; |
+ if (0 == fPendingExecutions) { |
+ if (0 == fRefCnt) { |
+ SkDELETE(this); |
+ } else { |
+ // Now our pending executions have ocurred and we still have refs. Convert |
+ // ownership of our resources back to regular refs. |
+ for (int i = 0; i < fProgramResources.count(); ++i) { |
+ fProgramResources[i]->pendingIOComplete(); |
+ } |
+ |
+ } |
+ } |
+} |