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

Unified Diff: src/core/SkStroke.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 | « src/core/SkStroke.h ('k') | src/core/SkStrokeRec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStroke.cpp
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index f8173c0555ade651cbf15c501f7c33253fc7ce8e..db76cafe35a94925ec19a93488be6cc8e79642ce 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -158,12 +158,12 @@ class SkPathStroker {
public:
#if QUAD_STROKE_APPROXIMATION
SkPathStroker(const SkPath& src,
- SkScalar radius, SkScalar miterLimit, SkScalar error, SkPaint::Cap cap,
- SkPaint::Join join);
+ SkScalar radius, SkScalar miterLimit, SkScalar error, SkPaint::Cap,
+ SkPaint::Join, SkScalar resScale);
#else
SkPathStroker(const SkPath& src,
- SkScalar radius, SkScalar miterLimit, SkPaint::Cap cap,
- SkPaint::Join join);
+ SkScalar radius, SkScalar miterLimit, SkPaint::Cap,
+ SkPaint::Join, SkScalar resScale);
#endif
void moveTo(const SkPoint&);
@@ -178,12 +178,15 @@ public:
dst->swap(fOuter);
}
+ SkScalar getResScale() const { return fResScale; }
+
private:
#if QUAD_STROKE_APPROXIMATION
SkScalar fError;
#endif
SkScalar fRadius;
SkScalar fInvMiterLimit;
+ SkScalar fResScale;
SkVector fFirstNormal, fPrevNormal, fFirstUnitNormal, fPrevUnitNormal;
SkPoint fFirstPt, fPrevPt; // on original path
@@ -348,13 +351,13 @@ void SkPathStroker::finishContour(bool close, bool currIsLine) {
#if QUAD_STROKE_APPROXIMATION
SkPathStroker::SkPathStroker(const SkPath& src,
SkScalar radius, SkScalar miterLimit, SkScalar error,
- SkPaint::Cap cap, SkPaint::Join join)
+ SkPaint::Cap cap, SkPaint::Join join, SkScalar resScale)
#else
SkPathStroker::SkPathStroker(const SkPath& src,
SkScalar radius, SkScalar miterLimit,
- SkPaint::Cap cap, SkPaint::Join join)
+ SkPaint::Cap cap, SkPaint::Join join, SkScalar resScale)
#endif
- : fRadius(radius) {
+ : fRadius(radius), fResScale(resScale) {
/* This is only used when join is miter_join, but we initialize it here
so that it is always defined, to fis valgrind warnings.
@@ -1429,14 +1432,13 @@ void SkStroke::strokePath(const SkPath& src, SkPath* dst) const {
}
SkAutoConicToQuads converter;
- const SkScalar conicTol = SK_Scalar1 / 4;
+ const SkScalar conicTol = SK_Scalar1 / 4 / fResScale;
#if QUAD_STROKE_APPROXIMATION
SkPathStroker stroker(src, radius, fMiterLimit, fError, this->getCap(),
- this->getJoin());
+ this->getJoin(), fResScale);
#else
- SkPathStroker stroker(src, radius, fMiterLimit, this->getCap(),
- this->getJoin());
+ SkPathStroker stroker(src, radius, fMiterLimit, this->getCap(), this->getJoin(), fResScale);
#endif
SkPath::Iter iter(src, false);
SkPath::Verb lastSegment = SkPath::kMove_Verb;
« no previous file with comments | « src/core/SkStroke.h ('k') | src/core/SkStrokeRec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698