diff options
author | bsalomon <bsalomon@google.com> | 2016-02-26 10:37:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-26 10:37:26 -0800 |
commit | b2c0133caf0f03462385c19634281c351355c979 (patch) | |
tree | f5a3bbbe93fbfa0d7f72dc93d9fe0865220139c8 /src/gpu/GrResourceCache.cpp | |
parent | 992ad363d7ca879cdb86f802b379f06800a44125 (diff) |
When a surface is backed by an external render target force a copy on image snap
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1694943002
Review URL: https://codereview.chromium.org/1694943002
Diffstat (limited to 'src/gpu/GrResourceCache.cpp')
-rw-r--r-- | src/gpu/GrResourceCache.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index 005b6c4ccd..087e762592 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->cacheAccess().isExternal()); + SkASSERT(!resource->resourcePriv().isExternal()); 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->cacheAccess().isExternal() && + if (!resource->resourcePriv().isExternal() && resource->resourcePriv().getScratchKey().isValid()) { // We won't purge an existing resource to make room for this one. if (fBudgetedCount < fMaxCount && @@ -662,19 +662,19 @@ void GrResourceCache::validate() const { SkASSERT(!resource->getUniqueKey().isValid()); ++fScratch; SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey())); - SkASSERT(!resource->cacheAccess().isExternal()); + SkASSERT(!resource->resourcePriv().isExternal()); } else if (resource->resourcePriv().getScratchKey().isValid()) { SkASSERT(SkBudgeted::kNo == resource->resourcePriv().isBudgeted() || resource->getUniqueKey().isValid()); ++fCouldBeScratch; SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey())); - SkASSERT(!resource->cacheAccess().isExternal()); + SkASSERT(!resource->resourcePriv().isExternal()); } const GrUniqueKey& uniqueKey = resource->getUniqueKey(); if (uniqueKey.isValid()) { ++fContent; SkASSERT(fUniqueHash->find(uniqueKey) == resource); - SkASSERT(!resource->cacheAccess().isExternal()); + SkASSERT(!resource->resourcePriv().isExternal()); SkASSERT(SkBudgeted::kYes == resource->resourcePriv().isBudgeted()); } |