Index: src/core/SkDraw.cpp |
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp |
index c42d3ef9ed6636e3895e426805d8e0b5ad52ba65..03b331108dc27226d5c761e303f4ba3bcc7d89ce 100644 |
--- a/src/core/SkDraw.cpp |
+++ b/src/core/SkDraw.cpp |
@@ -1004,6 +1004,17 @@ DRAW_PATH: |
this->drawPath(path, paint, NULL, true); |
} |
+static SkScalar compute_res_scale_for_stroking(const SkMatrix& matrix) { |
+ if (!matrix.hasPerspective()) { |
+ SkScalar sx = SkPoint::Length(matrix[SkMatrix::kMScaleX], matrix[SkMatrix::kMSkewY]); |
+ SkScalar sy = SkPoint::Length(matrix[SkMatrix::kMSkewX], matrix[SkMatrix::kMScaleY]); |
+ if (SkScalarsAreFinite(sx, sy)) { |
+ return SkTMax(sx, sy); |
+ } |
+ } |
+ return 1; |
+} |
+ |
void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, |
const SkMatrix* prePathMatrix, bool pathIsMutable, |
bool drawCoverage, SkBlitter* customBlitter) const { |
@@ -1072,7 +1083,8 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, |
if (this->computeConservativeLocalClipBounds(&cullRect)) { |
cullRectPtr = &cullRect; |
} |
- doFill = paint->getFillPath(*pathPtr, &tmpPath, cullRectPtr); |
+ doFill = paint->getFillPath(*pathPtr, &tmpPath, cullRectPtr, |
+ compute_res_scale_for_stroking(*fMatrix)); |
pathPtr = &tmpPath; |
} |