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

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

Issue 1718423002: Simplify and combine SkDrawCacheProc and SkMeasureCacheProc to SkPaint::GlyphCacheProc. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 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/SkTextToPathIter.h ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index a87e5d2b9d71a613c8a1ef92989bf9e0bb9f54a2..52281b2bbe228199b6934d55095cd9c27e3b81f7 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -440,7 +440,7 @@ void GrStencilAndCoverTextContext::TextRun::setText(const char text[], size_t by
SkASSERT(byteLength == 0 || text != nullptr);
SkGlyphCache* glyphCache = this->getGlyphCache();
- SkDrawCacheProc glyphCacheProc = fFont.getDrawCacheProc();
+ SkPaint::GlyphCacheProc glyphCacheProc = fFont.getGlyphCacheProc(true);
fTotalGlyphCount = fFont.countText(text, byteLength);
fInstanceData.reset(InstanceData::Alloc(GrPathRendering::kTranslate_PathTransformType,
@@ -457,7 +457,7 @@ void GrStencilAndCoverTextContext::TextRun::setText(const char text[], size_t by
while (textPtr < stop) {
// We don't need x, y here, since all subpixel variants will have the
// same advance.
- const SkGlyph& glyph = glyphCacheProc(glyphCache, &textPtr, 0, 0);
+ const SkGlyph& glyph = glyphCacheProc(glyphCache, &textPtr);
stopX += glyph.fAdvanceX;
stopY += glyph.fAdvanceY;
@@ -484,7 +484,7 @@ void GrStencilAndCoverTextContext::TextRun::setText(const char text[], size_t by
SkFixed fy = SkScalarToFixed(y);
FallbackBlobBuilder fallback;
while (text < stop) {
- const SkGlyph& glyph = glyphCacheProc(glyphCache, &text, 0, 0);
+ const SkGlyph& glyph = glyphCacheProc(glyphCache, &text);
fx += SkFixedMul(autokern.adjust(glyph), fixedSizeRatio);
if (glyph.fWidth) {
this->appendGlyph(glyph, SkPoint::Make(SkFixedToScalar(fx), SkFixedToScalar(fy)),
@@ -505,7 +505,7 @@ void GrStencilAndCoverTextContext::TextRun::setPosText(const char text[], size_t
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
SkGlyphCache* glyphCache = this->getGlyphCache();
- SkDrawCacheProc glyphCacheProc = fFont.getDrawCacheProc();
+ SkPaint::GlyphCacheProc glyphCacheProc = fFont.getGlyphCacheProc(true);
fTotalGlyphCount = fFont.countText(text, byteLength);
fInstanceData.reset(InstanceData::Alloc(GrPathRendering::kTranslate_PathTransformType,
@@ -517,7 +517,7 @@ void GrStencilAndCoverTextContext::TextRun::setPosText(const char text[], size_t
SkTextAlignProc alignProc(fFont.getTextAlign());
FallbackBlobBuilder fallback;
while (text < stop) {
- const SkGlyph& glyph = glyphCacheProc(glyphCache, &text, 0, 0);
+ const SkGlyph& glyph = glyphCacheProc(glyphCache, &text);
if (glyph.fWidth) {
SkPoint tmsLoc;
tmsProc(pos, &tmsLoc);
« no previous file with comments | « src/core/SkTextToPathIter.h ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698