aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathMeasure.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-08-21 13:27:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-21 13:27:37 -0700
commitdd3c165828fffb369d0f4b13b48381169a0249a9 (patch)
tree91dd40e798e4a6a982b43e414102d57a7a4809b1 /src/core/SkPathMeasure.cpp
parent1cbdcde9116e9efb514236faf8cfa42649a041d1 (diff)
experiment with zero-length round capped line segments
If the endcap is not butt, draw the endcaps even when the line has zero length. If the dash length is zero, generate a zero length line segment. Treat a move followed by a close as a move followed by a zero-length line. R=reed@google.com,schenney@google.com BUG=422974 Review URL: https://codereview.chromium.org/1309753002
Diffstat (limited to 'src/core/SkPathMeasure.cpp')
-rw-r--r--src/core/SkPathMeasure.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index a5dd84048c..17ae95e801 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -314,7 +314,12 @@ static void seg_to(const SkPoint pts[], int segType,
SkASSERT(startT <= stopT);
if (startT == stopT) {
- return; // should we report this, to undo a moveTo?
+ /* if the dash as a zero-length on segment, add a corresponding zero-length line.
+ The stroke code will add end caps to zero length lines as appropriate */
+ SkPoint lastPt;
+ SkAssertResult(dst->getLastPt(&lastPt));
+ dst->lineTo(lastPt);
+ return;
}
SkPoint tmp0[7], tmp1[7];
@@ -568,7 +573,7 @@ bool SkPathMeasure::getSegment(SkScalar startD, SkScalar stopD, SkPath* dst,
if (stopD > length) {
stopD = length;
}
- if (startD >= stopD) {
+ if (startD > stopD) {
return false;
}