Index: include/gpu/GrGpuResource.h |
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h |
index 947019b95a9af4e5587535deea11ae8548cfd1a8..8596d40134671ae59b8c29d1244883395c841be8 100644 |
--- a/include/gpu/GrGpuResource.h |
+++ b/include/gpu/GrGpuResource.h |
@@ -69,7 +69,7 @@ public: |
} |
protected: |
- GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0), fIsScratch(kNo_IsScratch) { } |
+ GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { } |
bool internalHasPendingRead() const { return SkToBool(fPendingReads); } |
bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); } |
@@ -116,16 +116,7 @@ private: |
// This class is used to manage conversion of refs to pending reads/writes. |
friend class GrGpuResourceRef; |
- |
- // This is temporary until GrResourceCache is fully replaced by GrResourceCache2. |
- enum IsScratch { |
- kNo_IsScratch, |
- kYes_IsScratch |
- } fIsScratch; |
- |
- friend class GrContext; // to set the above field. |
- friend class GrResourceCache; // to check the above field. |
- friend class GrResourceCache2; // to check the above field. |
+ friend class GrResourceCache2; // to check IO ref counts. |
template <typename, GrIOType> friend class GrPendingIOResource; |
}; |
@@ -188,6 +179,12 @@ public: |
*/ |
const GrResourceKey& getScratchKey() const { return fScratchKey; } |
+ /** |
+ * If this resource is currently cached by its contents then this will return |
+ * the content key. Otherwise, NULL is returned. |
+ */ |
+ const GrResourceKey* getContentKey() const; |
+ |
/** |
* Gets an id that is unique for this GrGpuResource object. It is static in that it does |
* not change when the content of the GrGpuResource object changes. This will never return |