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

Unified Diff: src/gpu/GrProgramElement.cpp

Issue 739673002: Create GrOptDrawState before recording draw in GrInOrderDrawBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused function in pendingprogramelement Created 6 years, 1 month 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/GrProcOptInfo.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProgramElement.cpp
diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp
index 89d53e28db147d98289170b929570167314bb984..6611234e8a990f2f6011a094de54143509198917 100644
--- a/src/gpu/GrProgramElement.cpp
+++ b/src/gpu/GrProgramElement.cpp
@@ -17,43 +17,21 @@ uint32_t GrProgramElement::CreateUniqueID() {
return id;
}
-void GrProgramElement::convertRefToPendingExecution() const {
- // This function makes it so that all the GrGpuResourceRefs own a single ref to their
- // underlying GrGpuResource if there are any refs to the GrProgramElement and a single
- // pending read/write if there are any pending executions of the GrProgramElement. The
- // GrGpuResourceRef will give up its single ref and/or pending read/write in its destructor.
- SkASSERT(fRefCnt > 0);
- if (0 == fPendingExecutions) {
- for (int i = 0; i < fGpuResources.count(); ++i) {
- fGpuResources[i]->markPendingIO();
- }
- }
- ++fPendingExecutions;
- this->unref();
- if (0 == fRefCnt) {
- this->removeRefs();
+void GrProgramElement::addPendingIOs() const {
+ for (int i = 0; i < fGpuResources.count(); ++i) {
+ fGpuResources[i]->markPendingIO();
}
}
-void GrProgramElement::completedExecution() const {
- this->validate();
- --fPendingExecutions;
- if (0 == fPendingExecutions) {
- if (0 == fRefCnt) {
- SkDELETE(this);
- } else {
- // Now our pending executions have ocurred and we still have refs. Convert
- // ownership of our resources back to regular refs.
- for (int i = 0; i < fGpuResources.count(); ++i) {
- fGpuResources[i]->pendingIOComplete();
- }
-
- }
+void GrProgramElement::removeRefs() const {
+ for (int i = 0; i < fGpuResources.count(); ++i) {
+ fGpuResources[i]->removeRef();
}
}
-void GrProgramElement::removeRefs() const {
+void GrProgramElement::pendingIOComplete() const {
for (int i = 0; i < fGpuResources.count(); ++i) {
- fGpuResources[i]->removeRef();
+ fGpuResources[i]->pendingIOComplete();
}
}
+
« no previous file with comments | « src/gpu/GrProcOptInfo.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698