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

Unified Diff: src/gpu/GrGpuResource.cpp

Issue 639873002: Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: rebase again Created 6 years, 2 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/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698