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

Unified Diff: src/core/SkStroke.cpp

Issue 1805913002: skip stroke outset of all teeny lines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify example Created 4 years, 9 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 | « gm/arcto.cpp ('k') | no next file » | 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 370cbdc09bbe7b2ea10225991269d600f64c84a8..9c26294129fced80b19ef535ad4f27ac9d196cc6 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -406,11 +406,11 @@ static bool has_valid_tangent(const SkPath::Iter* iter) {
}
void SkPathStroker::lineTo(const SkPoint& currPt, const SkPath::Iter* iter) {
- if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper
- && fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero * fInvResScale)) {
+ bool teenyLine = fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero * fInvResScale);
+ if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper && teenyLine) {
return;
}
- if (fPrevPt == currPt && (fJoinCompleted || (iter && has_valid_tangent(iter)))) {
+ if (teenyLine && (fJoinCompleted || (iter && has_valid_tangent(iter)))) {
return;
}
SkVector normal, unitNormal;
« no previous file with comments | « gm/arcto.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698