Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1027)

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1050113004: Adding bulk plot reffer to cached textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atlastext
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index d9807abafd9dcff92faebdd3a5714db47f95c0d4..fbfb17c02a57f3c019e060d6f18977a2918cef54 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -815,6 +815,7 @@ public:
GrBatchTextStrike* strike = NULL;
bool brokenRun = false;
if (regenerateTextureCoords) {
+ info.fBulkTokenReffer.reset();
desc = run.fDescriptor.getDesc();
cache = SkGlyphCache::DetachCache(run.fTypeface, desc);
scaler = GrTextContext::GetGrFontScaler(cache);
@@ -841,7 +842,8 @@ public:
SkASSERT(success);
}
- fFontCache->setGlyphRefToken(glyph, batchTarget->currentToken());
+ fFontCache->setGlyphRefToken(&info.fBulkTokenReffer,
+ glyph, batchTarget->currentToken());
// Texture coords are the last vertex attribute so we get a pointer to the
// first one and then map with stride in regenerateTextureCoords
@@ -870,6 +872,9 @@ public:
}
} else {
instancesToFlush += glyphCount;
+
+ // Ref all of the plots in the atlas to prevent eviction
+ fFontCache->setRefTokenBulk(info.fBulkTokenReffer, fMaskFormat);
}
// now copy all vertices
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrBatchAtlas.h » ('j') | src/gpu/GrBatchAtlas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698