| Index: src/gpu/GrResourceCache2.cpp
|
| diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
|
| index 664231919263afbefb133c4883485891e89a2a04..713375e28d126ebd381adea46608bc3aa6bb1dfc 100644
|
| --- a/src/gpu/GrResourceCache2.cpp
|
| +++ b/src/gpu/GrResourceCache2.cpp
|
| @@ -20,20 +20,20 @@ void GrResourceCache2::insertResource(GrGpuResource* resource) {
|
| SkASSERT(!this->isInCache(resource));
|
| fResources.addToHead(resource);
|
| ++fCount;
|
| - if (!resource->getScratchKey().isNullScratch()) {
|
| + if (!resource->cacheAccess().getScratchKey().isNullScratch()) {
|
| // TODO(bsalomon): Make this assertion possible.
|
| // SkASSERT(!resource->isWrapped());
|
| - fScratchMap.insert(resource->getScratchKey(), resource);
|
| + fScratchMap.insert(resource->cacheAccess().getScratchKey(), resource);
|
| }
|
| }
|
|
|
| void GrResourceCache2::removeResource(GrGpuResource* resource) {
|
| SkASSERT(this->isInCache(resource));
|
| fResources.remove(resource);
|
| - if (!resource->getScratchKey().isNullScratch()) {
|
| - fScratchMap.remove(resource->getScratchKey(), resource);
|
| + if (!resource->cacheAccess().getScratchKey().isNullScratch()) {
|
| + fScratchMap.remove(resource->cacheAccess().getScratchKey(), resource);
|
| }
|
| - if (const GrResourceKey* contentKey = resource->getContentKey()) {
|
| + if (const GrResourceKey* contentKey = resource->cacheAccess().getContentKey()) {
|
| fContentHash.remove(*contentKey);
|
| }
|
| --fCount;
|
| @@ -67,7 +67,7 @@ public:
|
| AvailableForScratchUse(bool rejectPendingIO) : fRejectPendingIO(rejectPendingIO) { }
|
|
|
| bool operator()(const GrGpuResource* resource) const {
|
| - if (!resource->reffedOnlyByCache() || !resource->isScratch()) {
|
| + if (!resource->reffedOnlyByCache() || !resource->cacheAccess().isScratch()) {
|
| return false;
|
| }
|
|
|
| @@ -95,23 +95,12 @@ GrGpuResource* GrResourceCache2::findAndRefScratchResource(const GrResourceKey&
|
| return SkSafeRef(fScratchMap.find(scratchKey, AvailableForScratchUse(false)));
|
| }
|
|
|
| -#if 0
|
| -void GrResourceCache2::willRemoveContentKey(const GrGpuResource* resource) {
|
| - SkASSERT(resource);
|
| - SkASSERT(resource->getContentKey());
|
| - SkDEBUGCODE(GrGpuResource* res = fContentHash.find(*resource->getContentKey()));
|
| - SkASSERT(res == resource);
|
| -
|
| - fContentHash.remove(*resource->getContentKey());
|
| -}
|
| -#endif
|
| -
|
| bool GrResourceCache2::didSetContentKey(GrGpuResource* resource) {
|
| SkASSERT(resource);
|
| - SkASSERT(resource->getContentKey());
|
| - SkASSERT(!resource->getContentKey()->isScratch());
|
| + SkASSERT(resource->cacheAccess().getContentKey());
|
| + SkASSERT(!resource->cacheAccess().getContentKey()->isScratch());
|
|
|
| - GrGpuResource* res = fContentHash.find(*resource->getContentKey());
|
| + GrGpuResource* res = fContentHash.find(*resource->cacheAccess().getContentKey());
|
| if (NULL != res) {
|
| return false;
|
| }
|
|
|