diff options
author | Florin Malita <fmalita@chromium.org> | 2017-03-09 14:21:44 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-09 20:51:01 +0000 |
commit | db3ceb86421fb9da86bb920e3a1f0957beec08d9 (patch) | |
tree | 7039b1b691ae4b5c4fe9e91bf9a74f4af28c4504 /src/gpu/text/GrTextBlobCache.cpp | |
parent | c1e37059a84044db2db5ae90fa0dd7c7278d9f66 (diff) |
Hold sk_sp<GrAtlasTextBlob> refs in GrTextBlobCache instead of raw ptrs
Refactor to store sk_sps, and minimize explicit ref manipulation.
Change-Id: Ie3d18e5fe1cefbbc5c2f3c4941287a24038522a6
Reviewed-on: https://skia-review.googlesource.com/9490
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.cpp')
-rw-r--r-- | src/gpu/text/GrTextBlobCache.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp index f6dac691f4..c53fcb0492 100644 --- a/src/gpu/text/GrTextBlobCache.cpp +++ b/src/gpu/text/GrTextBlobCache.cpp @@ -8,14 +8,13 @@ #include "GrTextBlobCache.h" GrTextBlobCache::~GrTextBlobCache() { - this->freeAll(); + SkDEBUGCODE(this->freeAll();) } void GrTextBlobCache::freeAll() { fBlobIDCache.foreach([this](uint32_t, BlobIDCacheEntry* entry) { - for (auto* blob : entry->fBlobs) { - fBlobList.remove(blob); - blob->unref(); + for (const auto& blob : entry->fBlobs) { + fBlobList.remove(blob.get()); } }); |