aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-09-09 09:34:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-09 09:34:22 -0700
commit5ca4fa3846067a47e88d35ace895df3ebe3ec2a5 (patch)
treeba745ddb320f96a452ff6a9984d9559ad2632acf /src
parent6c59d80858f453a426df9b07fdf3a8cc01e0b906 (diff)
Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
Reason for revert: breaks DEPS Original issue's description: > more zero-length changes for svg compatibility > > If a path contains a moveTo followed by a line or curve, > even if the line or curve has no length, SVG expects > the end caps to draw if the cap style is round or square. > > Fredrik Söderquist attached a patch to the chrome bug > (slightly modified here) that fixes layout test failures > resulting from deleting special-case code in SVG > dealing with zero-length path segments. > > R=reed@google.com,fs@opera.com > BUG=22974 > > Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15 TBR=fs@opera.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=22974 Review URL: https://codereview.chromium.org/1334543002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp2
-rw-r--r--src/core/SkStroke.cpp12
2 files changed, 1 insertions, 13 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 3a289566cb..7043ec3bc3 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2124,8 +2124,8 @@ void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
if (r.width() <= 0 && r.height() <= 0) {
if (path.isInverseFillType()) {
this->internalDrawPaint(paint);
- return;
}
+ return;
}
LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds)
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index 522a000712..1689f9730b 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -619,10 +619,6 @@ void SkPathStroker::conicTo(const SkPoint& pt1, const SkPoint& pt2, SkScalar wei
SkPoint reduction;
ReductionType reductionType = CheckConicLinear(conic, &reduction);
if (kPoint_ReductionType == reductionType) {
- /* If the stroke consists of a moveTo followed by a degenerate curve, treat it
- as if it were followed by a zero-length line. Lines without length
- can have square and round end caps. */
- this->lineTo(pt2);
return;
}
if (kLine_ReductionType == reductionType) {
@@ -657,10 +653,6 @@ void SkPathStroker::quadTo(const SkPoint& pt1, const SkPoint& pt2) {
SkPoint reduction;
ReductionType reductionType = CheckQuadLinear(quad, &reduction);
if (kPoint_ReductionType == reductionType) {
- /* If the stroke consists of a moveTo followed by a degenerate curve, treat it
- as if it were followed by a zero-length line. Lines without length
- can have square and round end caps. */
- this->lineTo(pt2);
return;
}
if (kLine_ReductionType == reductionType) {
@@ -1176,10 +1168,6 @@ void SkPathStroker::cubicTo(const SkPoint& pt1, const SkPoint& pt2,
const SkPoint* tangentPt;
ReductionType reductionType = CheckCubicLinear(cubic, reduction, &tangentPt);
if (kPoint_ReductionType == reductionType) {
- /* If the stroke consists of a moveTo followed by a degenerate curve, treat it
- as if it were followed by a zero-length line. Lines without length
- can have square and round end caps. */
- this->lineTo(pt3);
return;
}
if (kLine_ReductionType == reductionType) {