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

Unified Diff: src/gpu/batches/GrAtlasTextBatch.cpp

Issue 1983353003: Attempt to improve lifetime management of SkGlyphCache in Ganesh atlas text code. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixtest
Patch Set: Updated to only compare descriptors Created 4 years, 7 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
« no previous file with comments | « src/core/SkGlyphCache.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 2da4938e79208b9970f97c89c0054da32811b1eb..5a41457c5814b02413975e266562e133c020f8bf 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -132,23 +132,17 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
unsigned char* currVertex = reinterpret_cast<unsigned char*>(vertices);
- // We cache some values to avoid going to the glyphcache for the same fontScaler twice
- // in a row
- const SkDescriptor* desc = nullptr;
- SkGlyphCache* cache = nullptr;
- SkTypeface* typeface = nullptr;
-
GrBlobRegenHelper helper(this, target, &flushInfo);
-
+ SkAutoGlyphCache glyphCache;
for (int i = 0; i < fGeoCount; i++) {
const Geometry& args = fGeoData[i];
Blob* blob = args.fBlob;
size_t byteCount;
void* blobVertices;
int subRunGlyphCount;
- blob->regenInBatch(target, fFontCache, &helper, args.fRun, args.fSubRun, &cache,
- &typeface, &desc, vertexStride, args.fViewMatrix, args.fX,
- args.fY, args.fColor, &blobVertices, &byteCount, &subRunGlyphCount);
+ blob->regenInBatch(target, fFontCache, &helper, args.fRun, args.fSubRun, &glyphCache,
+ vertexStride, args.fViewMatrix, args.fX, args.fY, args.fColor,
+ &blobVertices, &byteCount, &subRunGlyphCount);
// now copy all vertices
memcpy(currVertex, blobVertices, byteCount);
@@ -172,10 +166,6 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
currVertex += byteCount;
}
- // Make sure to attach the last cache if applicable
- if (cache) {
- SkGlyphCache::AttachCache(cache);
- }
this->flush(target, &flushInfo);
}
« no previous file with comments | « src/core/SkGlyphCache.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698