aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar deanm <deanm@chromium.org>2016-04-26 14:12:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-26 14:12:22 -0700
commitb77821c30cd07507447244271eedf4e7c615e35a (patch)
tree4aff089f2dd6a392202b3a0f0b0a79bc3244fbfd
parent12670eb63b743283cf6f0e6e568c1713756e4006 (diff)
pathops: Cosmetic only change, update comments around ComplexBreak().
Rename loopT to splitT and make it clearer that it is not just self intersecting loop cubics that are split. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1921173003 Review URL: https://codereview.chromium.org/1921173003
-rw-r--r--src/pathops/SkOpEdgeBuilder.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pathops/SkOpEdgeBuilder.cpp b/src/pathops/SkOpEdgeBuilder.cpp
index 24ca9b1f56..617ca76c82 100644
--- a/src/pathops/SkOpEdgeBuilder.cpp
+++ b/src/pathops/SkOpEdgeBuilder.cpp
@@ -199,12 +199,13 @@ bool SkOpEdgeBuilder::walk(SkChunkAlloc* allocator) {
fCurrentContour->addConic(pointsPtr, *weightPtr++, fAllocator);
break;
case SkPath::kCubic_Verb: {
- // split self-intersecting cubics in two before proceeding
- // if the cubic is convex, it doesn't self intersect.
- SkScalar loopT;
- if (SkDCubic::ComplexBreak(pointsPtr, &loopT)) {
- SkPoint cubicPair[7];
- SkChopCubicAt(pointsPtr, cubicPair, loopT);
+ // Split complex cubics (such as self-intersecting curves or
+ // ones with difficult curvature) in two before proceeding.
+ // This can be required for intersection to succeed.
+ SkScalar splitT;
+ if (SkDCubic::ComplexBreak(pointsPtr, &splitT)) {
+ SkPoint cubicPair[7];
+ SkChopCubicAt(pointsPtr, cubicPair, splitT);
if (!SkScalarsAreFinite(&cubicPair[0].fX, SK_ARRAY_COUNT(cubicPair) * 2)) {
return false;
}