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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 639873002: Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: rebase again Created 6 years, 2 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/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.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 c683b5bcfcc0e65cf53bf459909ce025cb9cbd68..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);
///////////////////////////////////////////////////////////////////////////////
@@ -181,7 +178,7 @@ void GrResourceCache::notifyPurgable(const GrGpuResource* resource) {
// 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;
}
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698