Index: src/core/SkDraw.cpp |
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp |
index 24c80557168c8019adfb54f62e361520960b2c15..dc4a4a40bb887350ba771b38a3a6674b837db1b8 100644 |
--- a/src/core/SkDraw.cpp |
+++ b/src/core/SkDraw.cpp |
@@ -1900,6 +1900,18 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength, |
SkAutoGlyphCache autoCache(paint, NULL, NULL); |
SkGlyphCache* cache = autoCache.getCache(); |
+ // After SkGlyphCache is detached, the path effect should be set to NULL in |
+ // SkPaint. And the path for text will be filled, so SkPaint should be set |
+ // to fill style, w/ the exception of hairline stroked text w/o path effect. |
+ if (origPaint.getStyle() == SkPaint::kStroke_Style && |
+ origPaint.getStrokeWidth() == 0 && origPaint.getPathEffect() == NULL) { |
+ paint.setStyle(SkPaint::kStroke_Style); |
+ } else { |
+ paint.setStyle(SkPaint::kFill_Style); |
+ } |
+ |
+ paint.setPathEffect(NULL); |
+ |
const char* stop = text + byteLength; |
AlignProc_scalar alignProc = pick_align_proc_scalar(paint.getTextAlign()); |
TextMapState tms(SkMatrix::I(), constY); |