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

Unified Diff: src/pathops/SkOpEdgeBuilder.cpp

Issue 1921173003: pathops: Cosmetic only change, update comments around ComplexBreak(). (Closed) Base URL: https://skia.googlesource.com/skia.git/@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpEdgeBuilder.cpp
diff --git a/src/pathops/SkOpEdgeBuilder.cpp b/src/pathops/SkOpEdgeBuilder.cpp
index 24ca9b1f5687626ddde4f194b1fe3bda47330506..617ca76c821ffc505ae2d0b22453bbbfc8edc793 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698