aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuResourceCacheAccess.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-11-13 13:33:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-13 13:33:28 -0800
commitf21dab95405979a4aff9f6a741c818304a67f220 (patch)
tree9dba5c1c7bb95c5197d7708ef3fa057fe91e6c4f /src/gpu/GrGpuResourceCacheAccess.h
parent66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 (diff)
Revert of Replace GrResourceCache with GrResourceCache2. (patchset #6 id:100001 of https://codereview.chromium.org/716143004/)
Reason for revert: Breaking stuff Original issue's description: > Replace GrResourceCache with GrResourceCache2. > > BUG=skia:2889 > > Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2889 Review URL: https://codereview.chromium.org/715333003
Diffstat (limited to 'src/gpu/GrGpuResourceCacheAccess.h')
-rw-r--r--src/gpu/GrGpuResourceCacheAccess.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h
index 7417a55a71..af5c05464b 100644
--- a/src/gpu/GrGpuResourceCacheAccess.h
+++ b/src/gpu/GrGpuResourceCacheAccess.h
@@ -29,6 +29,25 @@ public:
}
/**
+ * Used by legacy cache to attach a cache entry. This is to be removed soon.
+ */
+ void setCacheEntry(GrResourceCacheEntry* cacheEntry) {
+ // GrResourceCache never changes the cacheEntry once one has been added.
+ SkASSERT(NULL == cacheEntry || NULL == fResource->fCacheEntry);
+ fResource->fCacheEntry = cacheEntry;
+ }
+
+ /**
+ * Is the resource in the legacy cache? This is to be removed soon.
+ */
+ bool isInCache() const { return SkToBool(fResource->fCacheEntry); }
+
+ /**
+ * Returns the cache entry for the legacy cache. This is to be removed soon.
+ */
+ GrResourceCacheEntry* getCacheEntry() const { return fResource->fCacheEntry; }
+
+ /**
* Is the resource currently cached as scratch? This means it has a valid scratch key and does
* not have a content key.
*/