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

Unified Diff: src/core/SkDraw.cpp

Issue 1458193003: Move glyph choosing to the find and place glyph code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comments and fixes. Created 5 years, 1 month 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 | « no previous file | src/core/SkFindAndPlaceGlyph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index ca84e629eeaf81a5d06e564f501180acb13bd55d..ef073f81598aeba601b871cea8c022607a58894f 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1580,7 +1580,6 @@ void SkDraw::drawText(const char text[], size_t byteLength,
return;
}
- SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
SkAutoGlyphCache autoCache(paint, &fDevice->surfaceProps(), fMatrix);
SkGlyphCache* cache = autoCache.getCache();
@@ -1600,7 +1599,8 @@ void SkDraw::drawText(const char text[], size_t byteLength,
SkDraw1Glyph::Proc proc = d1g.init(this, blitter, cache, paint);
SkFindAndPlaceGlyph::ProcessText(
- text, byteLength, {x, y}, *fMatrix, paint.getTextAlign(), glyphCacheProc, cache,
+ paint.getTextEncoding(), text, byteLength,
+ {x, y}, *fMatrix, paint.getTextAlign(), cache,
[&](const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
proc(d1g, SkScalarTo48Dot16(position.fX), SkScalarTo48Dot16(position.fY), glyph);
@@ -1695,11 +1695,10 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
SkDraw1Glyph d1g;
SkDraw1Glyph::Proc proc = d1g.init(this, blitter, cache, paint);
SkPaint::Align textAlignment = paint.getTextAlign();
- SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
SkFindAndPlaceGlyph::ProcessPosText(
- text, byteLength, offset, *fMatrix, pos, scalarsPerPosition,
- textAlignment, glyphCacheProc, cache,
+ paint.getTextEncoding(), text, byteLength,
+ offset, *fMatrix, pos, scalarsPerPosition, textAlignment, cache,
[&](const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
proc(d1g, SkScalarTo48Dot16(position.fX), SkScalarTo48Dot16(position.fY), glyph);
« no previous file with comments | « no previous file | src/core/SkFindAndPlaceGlyph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698