Make callback std::function
* change some {} to = default;
Change-Id: I22aea84d74b4a5b0c826618d18d6eb300c5dcfa4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291360
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp
index 37489c6..619bb4f 100644
--- a/src/gpu/text/GrTextBlobCache.cpp
+++ b/src/gpu/text/GrTextBlobCache.cpp
@@ -15,14 +15,11 @@
return msg.fContextID == msgBusUniqueID;
}
-GrTextBlobCache::GrTextBlobCache(GrTextBlobCache::PFOverBudgetCB cb, void* data, uint32_t uniqueID)
- : fCallback(cb)
- , fData(data)
+GrTextBlobCache::GrTextBlobCache(PurgeMore purgeMore, uint32_t uniqueID)
+ : fPurgeMore(purgeMore)
, fSizeBudget(kDefaultBudget)
, fUniqueID(uniqueID)
- , fPurgeBlobInbox(uniqueID) {
- SkASSERT(cb != nullptr && data != nullptr);
-}
+ , fPurgeBlobInbox(uniqueID) { }
GrTextBlobCache::~GrTextBlobCache() {
this->freeAll();
@@ -133,7 +130,7 @@
// use the call back and try to free some more. If we are still overbudget after this,
// then this single textblob is over our budget
if (blob && lruBlob == blob) {
- (*fCallback)(fData);
+ fPurgeMore();
}
#ifdef SPEW_BUDGET_MESSAGE