Move glyph choosing to the find and place glyph code.
This duplicates the functionality of the (private)
SkPaint::getDrawCacheProc method into
SkFindAndPlaceGlyph::LookupGlyph. Eventually LookupGlyph
should replace getDrawCacheProc, at which point it should be
removed. The remaining users are gpu and pdf.
Review URL: https://codereview.chromium.org/1458193003
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index bb6a6ce..c158ec1 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -775,13 +775,14 @@
}
fCurrStrike = nullptr;
- SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
// Get GrFontScaler from cache
GrFontScaler* fontScaler = GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessText(
- text, byteLength, {x, y}, viewMatrix, skPaint.getTextAlign(), glyphCacheProc, cache,
+ skPaint.getTextEncoding(), text, byteLength,
+ {x, y}, viewMatrix, skPaint.getTextAlign(),
+ cache,
[&](const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
this->bmpAppendGlyph(
@@ -808,14 +809,14 @@
}
fCurrStrike = nullptr;
- SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
// Get GrFontScaler from cache
GrFontScaler* fontScaler = GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessPosText(
- text, byteLength, offset, viewMatrix, pos, scalarsPerPosition,
- skPaint.getTextAlign(), glyphCacheProc, cache,
+ skPaint.getTextEncoding(), text, byteLength,
+ offset, viewMatrix, pos, scalarsPerPosition,
+ skPaint.getTextAlign(), cache,
[&](const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
this->bmpAppendGlyph(