diff options
author | Herb Derby <herb@google.com> | 2018-07-16 11:19:04 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-19 16:25:55 +0000 |
commit | cddab25218c52327ee1c527d726e69aa89540917 (patch) | |
tree | 91a8bd583444bed7903bc51953c35e4b6f02c92b /src/gpu/text/GrTextBlobCache.h | |
parent | 297c3c8e85bdb7ed79aaa6a596f52874d79e7a25 (diff) |
Use SkGlyphRunListIterator in gpu
Instead of using the text blob through the stack start
using the glyph run list.
This CL is similar to a portion of https://skia-review.googlesource.com/c/skia/+/137224
which was reverted.
Change-Id: I1f0619bd2d13523f9af1a68ab27fb26abd086add
Reviewed-on: https://skia-review.googlesource.com/141543
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
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; |