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

Unified Diff: src/core/SkStroke.cpp

Issue 1304163008: Revert of experiment with zero-length round capped line segments (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/SkPathMeasure.cpp ('k') | src/utils/SkDashPath.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 2db5bba524abf495a2366c525d4ef4626a732280..ede3d21055ee68a68b67775623ec268c71c117ed 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -120,9 +120,6 @@
SkPathStroker(const SkPath& src,
SkScalar radius, SkScalar miterLimit, SkPaint::Cap,
SkPaint::Join, SkScalar resScale);
-
- bool hasOnlyMoveTo() const { return 0 == fSegmentCount; }
- SkPoint moveToPt() const { return fFirstPt; }
void moveTo(const SkPoint&);
void lineTo(const SkPoint&);
@@ -245,14 +242,7 @@
SkScalar prevY = fPrevPt.fY;
if (!set_normal_unitnormal(fPrevPt, currPt, fRadius, normal, unitNormal)) {
- if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper) {
- return false;
- }
- /* Square caps and round caps draw even if the segment length is zero.
- Since the zero length segment has no direction, set the orientation
- to upright as the default orientation */
- normal->set(fRadius, 0);
- unitNormal->set(1, 0);
+ return false;
}
if (fSegmentCount == 0) {
@@ -366,8 +356,7 @@
}
void SkPathStroker::lineTo(const SkPoint& currPt) {
- if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper
- && SkPath::IsLineDegenerate(fPrevPt, currPt, false)) {
+ if (SkPath::IsLineDegenerate(fPrevPt, currPt, false)) {
return;
}
SkVector normal, unitNormal;
@@ -1345,14 +1334,6 @@
lastSegment = SkPath::kCubic_Verb;
break;
case SkPath::kClose_Verb:
- if (stroker.hasOnlyMoveTo() && SkPaint::kButt_Cap != this->getCap()) {
- /* If the stroke consists of a moveTo followed by a close, treat it
- as if it were followed by a zero-length line. Lines without length
- can have square and round end caps. */
- stroker.lineTo(stroker.moveToPt());
- lastSegment = SkPath::kLine_Verb;
- break;
- }
stroker.close(lastSegment == SkPath::kLine_Verb);
break;
case SkPath::kDone_Verb:
« no previous file with comments | « src/core/SkPathMeasure.cpp ('k') | src/utils/SkDashPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698