diff options
Diffstat (limited to 'src/core/SkScalerContext.cpp')
-rw-r--r-- | src/core/SkScalerContext.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 57d8bc1ddf..b8cd107bd3 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -106,6 +106,15 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) { } } + // for now we have separate cache entries for devkerning on and off + // in the future we might share caches, but make our measure/draw + // code make the distinction. Thus we zap the values if the caller + // has not asked for them. + if ((fRec.fFlags & SkScalerContext::kDevKernText_Flag) == 0) { + // no devkern, so zap the fields + glyph->fLsbDelta = glyph->fRsbDelta = 0; + } + // if either dimension is empty, zap the image bounds of the glyph if (0 == glyph->fWidth || 0 == glyph->fHeight) { glyph->fWidth = 0; @@ -153,6 +162,8 @@ SK_ERROR: glyph->fTop = 0; glyph->fWidth = 0; glyph->fHeight = 0; + glyph->fLsbDelta = 0; + glyph->fRsbDelta = 0; // put a valid value here, in case it was earlier set to // MASK_FORMAT_JUST_ADVANCE glyph->fMaskFormat = fRec.fMaskFormat; @@ -874,6 +885,10 @@ void SkScalerContext::MakeRecAndEffects(const SkPaint& paint, #endif } + if (paint.isDevKernText()) { + flags |= SkScalerContext::kDevKernText_Flag; + } + if (style != SkPaint::kFill_Style && strokeWidth > 0) { rec->fFrameWidth = strokeWidth; rec->fMiterLimit = paint.getStrokeMiter(); |