Index: src/gpu/GrResourceCache.cpp |
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp |
index f50ed7d032f5988f48a04f36cd30d6e6cffb983a..c683b5bcfcc0e65cf53bf459909ce025cb9cbd68 100644 |
--- a/src/gpu/GrResourceCache.cpp |
+++ b/src/gpu/GrResourceCache.cpp |
@@ -6,9 +6,12 @@ |
* found in the LICENSE file. |
*/ |
+ |
+ |
#include "GrResourceCache.h" |
#include "GrGpuResource.h" |
#include "GrTexturePriv.h" |
+ |
DECLARE_SKMESSAGEBUS_MESSAGE(GrResourceInvalidatedMessage); |
@@ -178,7 +181,7 @@ |
// scratch texture reuse is turned off. |
SkASSERT(resource->getCacheEntry()); |
if (resource->getCacheEntry()->key().getResourceType() == GrTexturePriv::ResourceType() && |
- resource->getCacheEntry()->key().isScratch() && |
+ resource->fIsScratch && |
!fCaps->reuseScratchTextures() && |
!(static_cast<const GrTexture*>(resource)->desc().fFlags & |
kRenderTarget_GrTextureFlagBit)) { |
@@ -187,12 +190,12 @@ |
} |
GrGpuResource* GrResourceCache::find(const GrResourceKey& key) { |
- // GrResourceCache2 is responsible for scratch resources. |
- SkASSERT(!key.isScratch()); |
- |
GrAutoResourceCacheValidate atcv(this); |
- GrResourceCacheEntry* entry = fCache.find(key); |
+ GrResourceCacheEntry* entry = NULL; |
+ |
+ entry = fCache.find(key); |
+ |
if (NULL == entry) { |
return NULL; |
} |
@@ -201,6 +204,8 @@ |
this->internalDetach(entry); |
this->attachToHead(entry); |
+ // GrResourceCache2 is responsible for scratch resources. |
+ SkASSERT(GrGpuResource::kNo_IsScratch == entry->resource()->fIsScratch); |
return entry->fResource; |
} |