Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1315923004: Convert child FPs from refs to pending executions when parent converts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: working Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/gpu/GrProgramElement.h ('K') | « src/gpu/GrPrimitiveProcessor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProcessor.cpp
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 3cbf777253ddf4f2d543338f330647ddaedb4353..379d3904dc97f3b45c22a9aeceb074f48e4983dc 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,13 @@ int GrFragmentProcessor::registerChildProcessor(const GrFragmentProcessor* child
return index;
}
+void GrFragmentProcessor::notifyRefCntIsZero() const {
+ 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;
« include/gpu/GrProgramElement.h ('K') | « src/gpu/GrPrimitiveProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698