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

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: Update comments 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
« no previous file with comments | « 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..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;
« no previous file with comments | « src/gpu/GrPrimitiveProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698