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

Unified Diff: src/gpu/GrResourceCache2.cpp

Issue 886313005: make getContentKey() available in GrGpuResource public interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix resolve error Created 5 years, 11 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/GrResourceCache2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache2.cpp
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 65894d33141213c614491072acac28eb215a56e6..99c4270f995f2f31b9bb7bf3a16943ccc25c3261 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -132,8 +132,8 @@ void GrResourceCache2::removeResource(GrGpuResource* resource) {
if (resource->cacheAccess().getScratchKey().isValid()) {
fScratchMap.remove(resource->cacheAccess().getScratchKey(), resource);
}
- if (resource->cacheAccess().getContentKey().isValid()) {
- fContentHash.remove(resource->cacheAccess().getContentKey());
+ if (resource->getContentKey().isValid()) {
+ fContentHash.remove(resource->getContentKey());
}
this->validate();
}
@@ -225,9 +225,9 @@ bool GrResourceCache2::didSetContentKey(GrGpuResource* resource) {
SkASSERT(!fPurging);
SkASSERT(resource);
SkASSERT(this->isInCache(resource));
- SkASSERT(resource->cacheAccess().getContentKey().isValid());
+ SkASSERT(resource->getContentKey().isValid());
- GrGpuResource* res = fContentHash.find(resource->cacheAccess().getContentKey());
+ GrGpuResource* res = fContentHash.find(resource->getContentKey());
if (NULL != res) {
return false;
}
@@ -281,7 +281,7 @@ void GrResourceCache2::notifyPurgeable(GrGpuResource* resource) {
// Also purge if the resource has neither a valid scratch key nor a content key.
bool noKey = !resource->cacheAccess().getScratchKey().isValid() &&
- !resource->cacheAccess().getContentKey().isValid();
+ !resource->getContentKey().isValid();
if (overBudget || noKey) {
release = true;
}
@@ -435,18 +435,18 @@ void GrResourceCache2::validate() const {
}
if (resource->cacheAccess().isScratch()) {
- SkASSERT(!resource->cacheAccess().getContentKey().isValid());
+ SkASSERT(!resource->getContentKey().isValid());
++scratch;
SkASSERT(fScratchMap.countForKey(resource->cacheAccess().getScratchKey()));
SkASSERT(!resource->cacheAccess().isWrapped());
} else if (resource->cacheAccess().getScratchKey().isValid()) {
SkASSERT(!resource->cacheAccess().isBudgeted() ||
- resource->cacheAccess().getContentKey().isValid());
+ resource->getContentKey().isValid());
++couldBeScratch;
SkASSERT(fScratchMap.countForKey(resource->cacheAccess().getScratchKey()));
SkASSERT(!resource->cacheAccess().isWrapped());
}
- const GrContentKey& contentKey = resource->cacheAccess().getContentKey();
+ const GrContentKey& contentKey = resource->getContentKey();
if (contentKey.isValid()) {
++content;
SkASSERT(fContentHash.find(contentKey) == resource);
« no previous file with comments | « src/gpu/GrResourceCache2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698