diff options
author | Robert Phillips <robertphillips@google.com> | 2017-09-29 15:10:39 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-29 20:04:54 +0000 |
commit | 3ec9573ac3fd8b973fe4feda27c109d47cb5defc (patch) | |
tree | 676ac45e16766b9356a7b2bdcb27efd7ba1296fd /src/gpu/GrResourceCache.cpp | |
parent | 4faa0408c1fc414263a3116a76ede20cc52b1d97 (diff) |
Add unit test for pinned SkImages
Change-Id: I2e14353bc865b5994cc90ad643a6a58604955957
Reviewed-on: https://skia-review.googlesource.com/53500
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceCache.cpp')
-rw-r--r-- | src/gpu/GrResourceCache.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index fd39bbf29c..20acf547f6 100644 --- a/src/gpu/GrResourceCache.cpp +++ b/src/gpu/GrResourceCache.cpp @@ -196,12 +196,15 @@ void GrResourceCache::releaseAll() { this->processFreedGpuResources(); + // We must remove the uniqueKeys from the proxies here. While they possess a uniqueKey + // they also have a raw pointer back to this class (which is presumably going away)! UniquelyKeyedProxyHash::Iter iter(&fUniquelyKeyedProxies); - for (UniquelyKeyedProxyHash::Iter iter(&fUniquelyKeyedProxies) ; !iter.done(); ++iter) { + for (UniquelyKeyedProxyHash::Iter iter(&fUniquelyKeyedProxies); !iter.done(); ++iter) { GrTextureProxy& tmp = *iter; this->processInvalidProxyUniqueKey(tmp.getUniqueKey(), &tmp, false); } + SkASSERT(!fUniquelyKeyedProxies.count()); while(fNonpurgeableResources.count()) { GrGpuResource* back = *(fNonpurgeableResources.end() - 1); |