aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-05-01 11:57:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-02 15:15:08 +0000
commitfcac00f2f19e345e813f38f7fc9372b6d6eebf4b (patch)
tree5c6b360d138b00a3d5d9c167d2f71ad43451e7e9 /src/gpu/text
parentefe39bcfb82ddf8404b1df6f58809ff53dff4b99 (diff)
Reland "Remove devKerning"
This is a reland of c86c5c0144b85d0bc8ec791f9609ee2d4e7d835a Original change's description: > Remove devKerning > > Dev kerning is not supported by any scalers. This is > mostly removed. The remaining fields fRsbDelta and > fLsbDelta are kept to keep Android compiling. > > Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809 > Reviewed-on: https://skia-review.googlesource.com/124921 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> Change-Id: Ibf5fac5f1442c7e62392d5146ad460da27b10d5c Reviewed-on: https://skia-review.googlesource.com/125300 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp11
-rw-r--r--src/gpu/text/GrTextUtils.cpp2
2 files changed, 5 insertions, 8 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 27c8dea670..e99d9df044 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -498,7 +498,6 @@ void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runInd
pathPaint.setPathEffect(nullptr);
SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(pathPaint.getTextEncoding(),
- pathPaint.isDevKernText(),
true);
auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(
pathPaint, &props, SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr);
@@ -679,7 +678,7 @@ void GrAtlasTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
const SkPaint& skPaint = paint.skPaint();
SkPaint::GlyphCacheProc glyphCacheProc =
- SkPaint::GetGlyphCacheProc(skPaint.getTextEncoding(), skPaint.isDevKernText(), true);
+ SkPaint::GetGlyphCacheProc(skPaint.getTextEncoding(), true);
SkTArray<SkScalar> positions;
@@ -705,14 +704,13 @@ void GrAtlasTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
auto origPaintCache =
SkStrikeCache::FindOrCreateStrikeExclusive(*desc.getDesc(), effects, *typeface);
- SkAutoKern autokern;
const char* stop = text + byteLength;
while (textPtr < stop) {
// don't need x, y here, since all subpixel variants will have the
// same advance
const SkGlyph& glyph = glyphCacheProc(origPaintCache.get(), &textPtr);
- SkScalar width = SkFloatToScalar(glyph.fAdvanceX) + autokern.adjust(glyph);
+ SkScalar width = SkFloatToScalar(glyph.fAdvanceX);
positions.push_back(stopX + origin * width);
SkScalar height = SkFloatToScalar(glyph.fAdvanceY);
@@ -777,7 +775,7 @@ void GrAtlasTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex,
auto cache = blob->setupCache(runIndex, props, SkScalerContextFlags::kNone, dfPaint,
nullptr);
SkPaint::GlyphCacheProc glyphCacheProc =
- SkPaint::GetGlyphCacheProc(dfPaint.getTextEncoding(), dfPaint.isDevKernText(), true);
+ SkPaint::GetGlyphCacheProc(dfPaint.getTextEncoding(), true);
const char* stop = text + byteLength;
@@ -884,8 +882,7 @@ void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int
SkExclusiveStrikePtr cache;
const SkPaint& skPaint = paint.skPaint();
SkPaint::GlyphCacheProc glyphCacheProc =
- SkPaint::GetGlyphCacheProc(skPaint.getTextEncoding(),
- skPaint.isDevKernText(), true);
+ SkPaint::GetGlyphCacheProc(skPaint.getTextEncoding(), true);
SkColor textColor = paint.filteredPremulColor();
SkScalar textRatio = SK_Scalar1;
if (fUseScaledFallback) {
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 738cfb68be..ab332e0417 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -62,7 +62,7 @@ bool GrTextUtils::PathTextIter::next(const SkGlyph** skGlyph, const SkPath** pat
if (fText < fStop) {
const SkGlyph& glyph = fGlyphCacheProc(fCache.get(), &fText);
- fXPos += (fPrevAdvance + fAutoKern.adjust(glyph)) * fScale;
+ fXPos += fPrevAdvance * fScale;
SkASSERT(0 == fXYIndex || 1 == fXYIndex);
fPrevAdvance = SkFloatToScalar((&glyph.fAdvanceX)[fXYIndex]);