aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScalerContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkScalerContext.cpp')
-rw-r--r--src/core/SkScalerContext.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 50dbfc52b1..d47c314834 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -625,26 +625,30 @@ void SkScalerContext::internalGetPath(const SkGlyph& glyph, SkPath* fillPath,
path.transform(inverse, &localPath);
// now localPath is only affected by the paint settings, and not the canvas matrix
- SkScalar width = fRec.fFrameWidth;
-
+ SkStrokeRec rec(SkStrokeRec::kFill_InitStyle);
+
+ if (fRec.fFrameWidth > 0) {
+ rec.setStrokeStyle(fRec.fFrameWidth,
+ SkToBool(fRec.fFlags & kFrameAndFill_Flag));
+ // glyphs are always closed contours, so cap type is ignored,
+ // so we just pass something.
+ rec.setStrokeParams(SkPaint::kButt_Cap,
+ (SkPaint::Join)fRec.fStrokeJoin,
+ fRec.fMiterLimit);
+ }
+
if (fPathEffect) {
SkPath effectPath;
-
- if (fPathEffect->filterPath(&effectPath, localPath, &width)) {
+ if (fPathEffect->filterPath(&effectPath, localPath, &rec)) {
localPath.swap(effectPath);
}
}
- if (width > 0) {
- SkStroke stroker;
- SkPath outline;
-
- stroker.setWidth(width);
- stroker.setMiterLimit(fRec.fMiterLimit);
- stroker.setJoin((SkPaint::Join)fRec.fStrokeJoin);
- stroker.setDoFill(SkToBool(fRec.fFlags & kFrameAndFill_Flag));
- stroker.strokePath(localPath, &outline);
- localPath.swap(outline);
+ if (rec.needToApply()) {
+ SkPath strokePath;
+ if (rec.applyToPath(&strokePath, localPath)) {
+ localPath.swap(strokePath);
+ }
}
// now return stuff to the caller