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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1810323002: Cache render targets that render to wrapped textures Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 087e762592144f47f110d39ee1340659e0a2b489..ea6ab7d90b0311ef4d5ce2f7d4083671f82ac10e 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -147,7 +147,7 @@ void GrResourceCache::insertResource(GrGpuResource* resource) {
#endif
}
if (resource->resourcePriv().getScratchKey().isValid()) {
- SkASSERT(!resource->resourcePriv().isExternal());
+ SkASSERT(!resource->resourcePriv().refsWrappedResources());
fScratchMap.insert(resource->resourcePriv().getScratchKey(), resource);
}
@@ -377,7 +377,7 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla
if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) {
// Check whether this resource could still be used as a scratch resource.
- if (!resource->resourcePriv().isExternal() &&
+ if (!resource->resourcePriv().refsWrappedResources() &&
resource->resourcePriv().getScratchKey().isValid()) {
// We won't purge an existing resource to make room for this one.
if (fBudgetedCount < fMaxCount &&
@@ -662,19 +662,18 @@ void GrResourceCache::validate() const {
SkASSERT(!resource->getUniqueKey().isValid());
++fScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
- SkASSERT(!resource->resourcePriv().isExternal());
+ SkASSERT(!resource->resourcePriv().refsWrappedResources());
} else if (resource->resourcePriv().getScratchKey().isValid()) {
SkASSERT(SkBudgeted::kNo == resource->resourcePriv().isBudgeted() ||
resource->getUniqueKey().isValid());
++fCouldBeScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
- SkASSERT(!resource->resourcePriv().isExternal());
+ SkASSERT(!resource->resourcePriv().refsWrappedResources());
}
const GrUniqueKey& uniqueKey = resource->getUniqueKey();
if (uniqueKey.isValid()) {
++fContent;
SkASSERT(fUniqueHash->find(uniqueKey) == resource);
- SkASSERT(!resource->resourcePriv().isExternal());
SkASSERT(SkBudgeted::kYes == resource->resourcePriv().isBudgeted());
}
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrResourceProvider.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698