diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-12-14 13:00:05 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-14 18:52:49 +0000 |
commit | 474d68791965f20f8e0dfa2bfb4d87300f1f29e0 (patch) | |
tree | 538b3b1687625848ced2a730dfa5fb8355a76e3e /src/gpu/text/GrTextBlobCache.h | |
parent | de2b95ea976afa55e6dd41e3ad24b092faa33ae2 (diff) |
Send TextBlobCache purge messages only to owning cache.
Bug: 703297
Change-Id: I95cdaa5bdebadd5ce88ae3ee468c59baa08353c6
Reviewed-on: https://skia-review.googlesource.com/85046
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.h')
-rw-r--r-- | src/gpu/text/GrTextBlobCache.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h index dc7e4c5844..ac15124937 100644 --- a/src/gpu/text/GrTextBlobCache.h +++ b/src/gpu/text/GrTextBlobCache.h @@ -23,11 +23,13 @@ public: */ typedef void (*PFOverBudgetCB)(void* data); - GrTextBlobCache(PFOverBudgetCB cb, void* data) + GrTextBlobCache(PFOverBudgetCB cb, void* data, uint32_t uniqueID) : fPool(0u, kMinGrowthSize) , fCallback(cb) , fData(data) - , fBudget(kDefaultBudget) { + , fBudget(kDefaultBudget) + , fUniqueID(uniqueID) + , fPurgeBlobInbox(uniqueID) { SkASSERT(cb && data); } ~GrTextBlobCache(); @@ -51,7 +53,7 @@ public: sk_sp<GrAtlasTextBlob> cacheBlob(this->makeBlob(blob)); cacheBlob->setupKey(key, blurRec, paint); this->add(cacheBlob); - blob->notifyAddedToCache(); + blob->notifyAddedToCache(fUniqueID); return cacheBlob; } @@ -100,7 +102,7 @@ public: uint32_t fID; }; - static void PostPurgeBlobMessage(uint32_t); + static void PostPurgeBlobMessage(uint32_t blobID, uint32_t cacheID); void purgeStaleBlobs(); @@ -178,6 +180,7 @@ private: PFOverBudgetCB fCallback; void* fData; size_t fBudget; + uint32_t fUniqueID; // unique id to use for messaging SkMessageBus<PurgeBlobMessage>::Inbox fPurgeBlobInbox; }; |