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