Index: src/gpu/GrProcessor.cpp |
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp |
index db1e2d9f6198a0103c08728a8326b6dbf9ef5df3..3cbf777253ddf4f2d543338f330647ddaedb4353 100644 |
--- a/src/gpu/GrProcessor.cpp |
+++ b/src/gpu/GrProcessor.cpp |
@@ -130,6 +130,12 @@ bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const { |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
+GrFragmentProcessor::~GrFragmentProcessor() { |
+ for (int i = 0; i < fChildProcessors.count(); ++i) { |
+ fChildProcessors[i]->unref(); |
+ } |
+} |
+ |
bool GrFragmentProcessor::isEqual(const GrFragmentProcessor& that, |
bool ignoreCoordTransforms) const { |
if (this->classID() != that.classID() || |
@@ -161,7 +167,7 @@ GrGLFragmentProcessor* GrFragmentProcessor::createGLInstance() const { |
GrGLFragmentProcessor* glFragProc = this->onCreateGLInstance(); |
glFragProc->fChildProcessors.push_back_n(fChildProcessors.count()); |
for (int i = 0; i < fChildProcessors.count(); ++i) { |
- glFragProc->fChildProcessors[i] = fChildProcessors[i].processor()->createGLInstance(); |
+ glFragProc->fChildProcessors[i] = fChildProcessors[i]->createGLInstance(); |
} |
return glFragProc; |
} |
@@ -199,7 +205,7 @@ int GrFragmentProcessor::registerChildProcessor(const GrFragmentProcessor* child |
} |
int index = fChildProcessors.count(); |
- fChildProcessors.push_back(GrFragmentStage(child)); |
+ fChildProcessors.push_back(SkRef(child)); |
if (child->willReadFragmentPosition()) { |
this->setWillReadFragmentPosition(); |