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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 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/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index ae9c68f3c4f1d69264340c2ad1efe378c7b0eb1a..88128ac5000fdfb651b21d0ca2f39751f6738be1 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -146,7 +146,7 @@ void GrResourceCache::insertResource(GrGpuResource* resource) {
#endif
}
if (resource->resourcePriv().getScratchKey().isValid()) {
- SkASSERT(!resource->cacheAccess().isWrapped());
+ SkASSERT(!resource->cacheAccess().isExternal());
fScratchMap.insert(resource->resourcePriv().getScratchKey(), resource);
}
@@ -369,7 +369,7 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla
if (!resource->resourcePriv().isBudgeted()) {
// Check whether this resource could still be used as a scratch resource.
- if (!resource->cacheAccess().isWrapped() &&
+ if (!resource->cacheAccess().isExternal() &&
resource->resourcePriv().getScratchKey().isValid()) {
// We won't purge an existing resource to make room for this one.
if (fBudgetedCount < fMaxCount &&
@@ -645,19 +645,19 @@ void GrResourceCache::validate() const {
SkASSERT(!resource->getUniqueKey().isValid());
++fScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
- SkASSERT(!resource->cacheAccess().isWrapped());
+ SkASSERT(!resource->cacheAccess().isExternal());
} else if (resource->resourcePriv().getScratchKey().isValid()) {
SkASSERT(!resource->resourcePriv().isBudgeted() ||
resource->getUniqueKey().isValid());
++fCouldBeScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
- SkASSERT(!resource->cacheAccess().isWrapped());
+ SkASSERT(!resource->cacheAccess().isExternal());
}
const GrUniqueKey& uniqueKey = resource->getUniqueKey();
if (uniqueKey.isValid()) {
++fContent;
SkASSERT(fUniqueHash->find(uniqueKey) == resource);
- SkASSERT(!resource->cacheAccess().isWrapped());
+ SkASSERT(!resource->cacheAccess().isExternal());
SkASSERT(resource->resourcePriv().isBudgeted());
}
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698