Index: src/gpu/GrProcessor.cpp |
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp |
index 3cbf777253ddf4f2d543338f330647ddaedb4353..7a3335c3056a5f4587bc41a537c790dba9c78d37 100644 |
--- a/src/gpu/GrProcessor.cpp |
+++ b/src/gpu/GrProcessor.cpp |
@@ -131,8 +131,10 @@ bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const { |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
GrFragmentProcessor::~GrFragmentProcessor() { |
+ // If we got here then our ref count must have reached zero, so we will have converted refs |
+ // to pending executions for all children. |
for (int i = 0; i < fChildProcessors.count(); ++i) { |
- fChildProcessors[i]->unref(); |
+ fChildProcessors[i]->completedExecution(); |
} |
} |
@@ -218,6 +220,14 @@ int GrFragmentProcessor::registerChildProcessor(const GrFragmentProcessor* child |
return index; |
} |
+void GrFragmentProcessor::notifyRefCntIsZero() const { |
+ // See comment above GrProgramElement for a detailed explanation of why we do this. |
+ for (int i = 0; i < fChildProcessors.count(); ++i) { |
+ fChildProcessors[i]->addPendingExecution(); |
+ fChildProcessors[i]->unref(); |
+ } |
+} |
+ |
bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) const { |
if (this->numTransforms() != that.numTransforms()) { |
return false; |