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

Unified Diff: src/gpu/GrProgramResource.cpp

Issue 543833002: Add method to GrProgramResource to record that pending a execution was completed. (Closed) Base URL: https://skia.googlesource.com/skia.git@progelem
Patch Set: rebase Created 6 years, 3 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/GrProgramElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProgramResource.cpp
diff --git a/src/gpu/GrProgramResource.cpp b/src/gpu/GrProgramResource.cpp
index 08975ae041dd7a51cd6675ca19a7e85fc071a3f3..3bf25a1137a4bcbad53d935b3c651ebd9ca0b5f2 100644
--- a/src/gpu/GrProgramResource.cpp
+++ b/src/gpu/GrProgramResource.cpp
@@ -74,7 +74,7 @@ void GrProgramResource::setResource(GrGpuResource* resource, IOType ioType) {
}
void GrProgramResource::markPendingIO() const {
- // This should only be called once, when the owning GrProgramElement gets its first
+ // This should only be called when the owning GrProgramElement gets its first
// pendingExecution ref.
SkASSERT(!fPendingIO);
SkASSERT(NULL != fResource);
@@ -97,6 +97,30 @@ void GrProgramResource::markPendingIO() const {
}
}
+void GrProgramResource::pendingIOComplete() const {
+ // This should only be called when the owner's pending executions have ocurred but it is still
+ // reffed.
+ SkASSERT(fOwnRef);
+ SkASSERT(fPendingIO);
+ switch (fIOType) {
+ case kNone_IOType:
+ SkFAIL("GrProgramResource with neither reads nor writes?");
+ break;
+ case kRead_IOType:
+ fResource->completedRead();
+ break;
+ case kWrite_IOType:
+ fResource->completedWrite();
+ break;
+ case kRW_IOType:
+ fResource->completedRead();
+ fResource->completedWrite();
+ break;
+
+ }
+ fPendingIO = false;
+}
+
void GrProgramResource::removeRef() const {
// This should only be called once, when the owners last ref goes away and
// there is a pending execution.
« no previous file with comments | « src/gpu/GrProgramElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698