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

Unified Diff: include/gpu/GrProgramElement.h

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
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrProgramElement.h
diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h
index e788486b5cc74d0d4c898268d7754d3e3628b3ac..c71e2074fc41a9cf2c94d517a1142aa2f96a9959 100644
--- a/include/gpu/GrProgramElement.h
+++ b/include/gpu/GrProgramElement.h
@@ -44,6 +44,7 @@ public:
this->validate();
--fRefCnt;
if (0 == fRefCnt) {
+ this->notifyRefCntIsZero();
if (0 == fPendingExecutions) {
delete this;
return;
@@ -78,9 +79,6 @@ protected:
fGpuResources.push_back(res);
}
-private:
- static uint32_t CreateUniqueID();
-
void addPendingExecution() const {
this->validate();
SkASSERT(fRefCnt > 0);
@@ -105,6 +103,13 @@ private:
this->validate();
}
+private:
+ /** This will be called when the ref cnt is zero. The object may or may not have pending
+ executions. */
+ virtual void notifyRefCntIsZero() const = 0;
+
+ static uint32_t CreateUniqueID();
+
void removeRefs() const;
void addPendingIOs() const;
void pendingIOComplete() const;
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698