aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrGpuResource.h5
-rw-r--r--include/gpu/GrSurface.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index f20bad3e9f..61849e7232 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -80,9 +80,14 @@ public:
#endif
}
+
protected:
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
+ bool internalHasPendingRead() const { return SkToBool(fPendingReads); }
+ bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); }
+ bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendingReads); }
+
private:
void addPendingRead() const {
this->validate();
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 8315c63fbf..24eb39a81b 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -135,6 +135,10 @@ public:
*/
bool savePixels(const char* filename);
+ bool hasPendingRead() const;
+ bool hasPendingWrite() const;
+ bool hasPendingIO() const;
+
protected:
GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
: INHERITED(gpu, isWrapped)