diff options
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.h')
-rw-r--r-- | src/gpu/text/GrTextBlobCache.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h index a174c9cf90..72743f84ba 100644 --- a/src/gpu/text/GrTextBlobCache.h +++ b/src/gpu/text/GrTextBlobCache.h @@ -56,6 +56,21 @@ public: return cacheBlob; } + sk_sp<GrTextBlob> makeBlob(SkGlyphRunList* glyphRunList) { + return GrTextBlob::Make(glyphRunList->totalGlyphCount(), glyphRunList->size()); + } + + sk_sp<GrTextBlob> makeCachedBlob(SkGlyphRunList* glyphRunList, + const GrTextBlob::Key& key, + const SkMaskFilterBase::BlurRec& blurRec, + const SkPaint& paint) { + sk_sp<GrTextBlob> cacheBlob(makeBlob(glyphRunList)); + cacheBlob->setupKey(key, blurRec, paint); + this->add(cacheBlob); + glyphRunList->temporaryShuntBlobNotifyAddedToCache(fUniqueID); + return cacheBlob; + } + sk_sp<GrTextBlob> find(const GrTextBlob::Key& key) const { const auto* idEntry = fBlobIDCache.find(key.fUniqueID); return idEntry ? idEntry->find(key) : nullptr; |