aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatchFontCache.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-04-08 08:07:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-08 08:07:59 -0700
commitb4c507e03386f2105e33f0c4c09b4a9d0a23196d (patch)
tree832d11c9102cbfc9b7aa09c8ebc1ff50afad80cd /src/gpu/GrBatchFontCache.cpp
parent693e9930571929cbdc83f1e678b151a768c1bad8 (diff)
Adding bulk plot reffer to cached textblobs
This change will prevent the atlas from evicting glyphs the TextBlob needs. BUG=skia: Committed: https://skia.googlesource.com/skia/+/7281c61e7bc689d484dcbda49be3cef4ce4f11c2 Review URL: https://codereview.chromium.org/1050113004
Diffstat (limited to 'src/gpu/GrBatchFontCache.cpp')
-rw-r--r--src/gpu/GrBatchFontCache.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gpu/GrBatchFontCache.cpp b/src/gpu/GrBatchFontCache.cpp
index c429d539b8..3cd7a64a73 100644
--- a/src/gpu/GrBatchFontCache.cpp
+++ b/src/gpu/GrBatchFontCache.cpp
@@ -128,10 +128,18 @@ bool GrBatchFontCache::hasGlyph(GrGlyph* glyph) {
return this->getAtlas(glyph->fMaskFormat)->hasID(glyph->fID);
}
-void GrBatchFontCache::setGlyphRefToken(GrGlyph* glyph, GrBatchAtlas::BatchToken batchToken) {
+void GrBatchFontCache::addGlyphToBulkAndSetUseToken(GrBatchAtlas::BulkUseTokenUpdater* updater,
+ GrGlyph* glyph,
+ GrBatchAtlas::BatchToken token) {
SkASSERT(glyph);
- SkASSERT(this->getAtlas(glyph->fMaskFormat)->hasID(glyph->fID));
- this->getAtlas(glyph->fMaskFormat)->setLastRefToken(glyph->fID, batchToken);
+ updater->add(glyph->fID);
+ this->getAtlas(glyph->fMaskFormat)->setLastUseToken(glyph->fID, token);
+}
+
+void GrBatchFontCache::setUseTokenBulk(const GrBatchAtlas::BulkUseTokenUpdater& updater,
+ GrBatchAtlas::BatchToken token,
+ GrMaskFormat format) {
+ this->getAtlas(format)->setLastUseTokenBulk(updater, token);
}
bool GrBatchFontCache::addToAtlas(GrBatchTextStrike* strike, GrBatchAtlas::AtlasID* id,