aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextBlobCache.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-03-13 16:45:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-14 14:00:13 +0000
commit4a01ac9e410e7b78fb04c8632e0676082b9408aa (patch)
tree6a834475439e681020026500b3c7f6c13cb7bfef /src/gpu/text/GrTextBlobCache.cpp
parentb66b42f1749a7a23fd610d90605978537bf4fbb7 (diff)
Purge GrTextBlobCache entries on SkTextBlob deletion
Similar to the SkImage purge mechanism. Change-Id: I0b7fb1bad507a3c7f30a4f7514bedd894d1748ac Reviewed-on: https://skia-review.googlesource.com/9631 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.cpp')
-rw-r--r--src/gpu/text/GrTextBlobCache.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp
index c53fcb0492..f1162e2634 100644
--- a/src/gpu/text/GrTextBlobCache.cpp
+++ b/src/gpu/text/GrTextBlobCache.cpp
@@ -7,6 +7,8 @@
#include "GrTextBlobCache.h"
+DECLARE_SKMESSAGEBUS_MESSAGE(GrTextBlobCache::PurgeBlobMessage)
+
GrTextBlobCache::~GrTextBlobCache() {
SkDEBUGCODE(this->freeAll();)
}
@@ -24,3 +26,8 @@ void GrTextBlobCache::freeAll() {
SkASSERT(fPool.isEmpty());
SkASSERT(fBlobList.isEmpty());
}
+
+void GrTextBlobCache::PostPurgeBlobMessage(uint32_t id) {
+ SkASSERT(id != SK_InvalidGenID);
+ SkMessageBus<PurgeBlobMessage>::Post(PurgeBlobMessage({id}));
+}