Index: src/gpu/GrGpuResource.cpp |
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp |
index fdb5d479808816b77cbb4923888fd7e66282bc1f..705cdea4245984f025ae45fd01efc81fb801fe39 100644 |
--- a/src/gpu/GrGpuResource.cpp |
+++ b/src/gpu/GrGpuResource.cpp |
@@ -91,6 +91,18 @@ void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) { |
fScratchKey = scratchKey; |
} |
+const GrResourceKey* GrGpuResource::getContentKey() const { |
+ if (fCacheEntry && !fCacheEntry->key().isScratch()) { |
+ return &fCacheEntry->key(); |
+ } |
+ return NULL; |
+} |
+ |
+bool GrGpuResource::isScratch() const { |
+ // Currently scratch resources have a cache entry in GrResourceCache with a scratch key. |
+ return NULL != fCacheEntry && fCacheEntry->key().isScratch(); |
+} |
+ |
uint32_t GrGpuResource::CreateUniqueID() { |
static int32_t gUniqueID = SK_InvalidUniqueID; |
uint32_t id; |