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

Unified Diff: src/gpu/text/GrTextUtils.cpp

Issue 1551563003: Reland of Make draw* lines responsible for cache management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext13reallytexutilsdf
Patch Set: Created 5 years 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/gpu/text/GrTextUtils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrTextUtils.cpp
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 293ea4d891edac7888625522a1563b663bb9e675..9d6bb2c857dfa18de7a512bf1037e60d487dcd8d 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -23,7 +23,7 @@
void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache,
- SkGlyphCache* cache, const SkPaint& skPaint,
+ const SkSurfaceProps& props, const SkPaint& skPaint,
GrColor color,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
@@ -38,6 +38,7 @@
GrBatchTextStrike* currStrike = nullptr;
// Get GrFontScaler from cache
+ SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false);
GrFontScaler* fontScaler = GrTextContext::GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessText(
@@ -52,11 +53,13 @@
color, fontScaler);
}
);
+
+ SkGlyphCache::AttachCache(cache);
}
void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache,
- SkGlyphCache* cache, const SkPaint& skPaint,
+ const SkSurfaceProps& props, const SkPaint& skPaint,
GrColor color,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
@@ -73,6 +76,7 @@
GrBatchTextStrike* currStrike = nullptr;
// Get GrFontScaler from cache
+ SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false);
GrFontScaler* fontScaler = GrTextContext::GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessPosText(
@@ -87,6 +91,8 @@
color, fontScaler);
}
);
+
+ SkGlyphCache::AttachCache(cache);
}
void GrTextUtils::BmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
« no previous file with comments | « src/gpu/text/GrTextUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698