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. |