diff options
author | robertphillips <robertphillips@google.com> | 2016-07-19 07:59:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-19 07:59:22 -0700 |
commit | e34f17d23699abfc672289f51319b37294b3c257 (patch) | |
tree | eef74fb1356491c4a23c31e32ead9a275a8fa09c /src/gpu/text | |
parent | b117ff194ff888ef9107a4797aad053b0d76be30 (diff) |
Make SkFont a bit more useable
Split out of https://codereview.chromium.org/2163483002/ (Use SkFont in GrStencilAndCoverTextContext)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163633002
Review-Url: https://codereview.chromium.org/2163633002
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 8 | ||||
-rw-r--r-- | src/gpu/text/GrTextUtils.cpp | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index dd93025526..632bdcdaf1 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -469,7 +469,9 @@ void GrStencilAndCoverTextContext::TextRun::setText(const char text[], size_t by SkASSERT(byteLength == 0 || text != nullptr); SkGlyphCache* glyphCache = this->getGlyphCache(); - SkPaint::GlyphCacheProc glyphCacheProc = fFont.getGlyphCacheProc(true); + SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(fFont.getTextEncoding(), + fFont.isDevKernText(), + true); fTotalGlyphCount = fFont.countText(text, byteLength); fInstanceData.reset(InstanceData::Alloc(GrPathRendering::kTranslate_PathTransformType, @@ -529,7 +531,9 @@ void GrStencilAndCoverTextContext::TextRun::setPosText(const char text[], size_t SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition); SkGlyphCache* glyphCache = this->getGlyphCache(); - SkPaint::GlyphCacheProc glyphCacheProc = fFont.getGlyphCacheProc(true); + SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(fFont.getTextEncoding(), + fFont.isDevKernText(), + true); fTotalGlyphCount = fFont.countText(text, byteLength); fInstanceData.reset(InstanceData::Alloc(GrPathRendering::kTranslate_PathTransformType, diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp index 9205d2fd7c..56d4ec1c00 100644 --- a/src/gpu/text/GrTextUtils.cpp +++ b/src/gpu/text/GrTextUtils.cpp @@ -253,7 +253,9 @@ void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex, return; } - SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true); + SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(skPaint.getTextEncoding(), + skPaint.isDevKernText(), + true); SkAutoDescriptor desc; SkScalerContextEffects effects; // We apply the fake-gamma by altering the distance in the shader, so we ignore the @@ -345,7 +347,9 @@ void GrTextUtils::DrawDFPosText(GrAtlasTextBlob* blob, int runIndex, // passed-in scaler context flags. (It's only used when we fall-back to bitmap text). SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::kNone_ScalerContextFlags, dfPaint, nullptr); - SkPaint::GlyphCacheProc glyphCacheProc = dfPaint.getGlyphCacheProc(true); + SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(dfPaint.getTextEncoding(), + dfPaint.isDevKernText(), + true); const char* stop = text + byteLength; @@ -508,7 +512,9 @@ void GrTextUtils::DrawPosTextAsPath(GrContext* context, paint.setStyle(SkPaint::kFill_Style); paint.setPathEffect(nullptr); - SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); + SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(), + paint.isDevKernText(), + true); SkAutoGlyphCache autoCache(paint, &props, nullptr); SkGlyphCache* cache = autoCache.getCache(); |