Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/core/SkDraw.cpp

Issue 911053005: optional res-scale parameter to getFillPath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698