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

Unified Diff: src/pathops/SkPathOpsCommon.cpp

Issue 21359002: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove space Created 7 years, 3 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/pathops/SkPathOpsCommon.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCommon.cpp
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index 28cf59cdd37f491fd260340fb032c2ef98e1851d..7dd13a7fe8dd6958788c006d35c605f9e153da68 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -250,6 +250,9 @@ static SkOpSegment* findSortableTop(const SkTArray<SkOpContour*, true>& contourL
*topLeft = bestXY;
result = topStart->findTop(index, endIndex, unsortable, onlySortable);
} while (!result);
+ if (result) {
+ *unsortable = false;
+ }
return result;
}
@@ -288,9 +291,9 @@ static void skipVertical(const SkTArray<SkOpContour*, true>& contourList,
}
}
-SkOpSegment* FindSortableTop(const SkTArray<SkOpContour*, true>& contourList, bool* firstContour,
- int* indexPtr, int* endIndexPtr, SkPoint* topLeft, bool* unsortable,
- bool* done, bool binary) {
+SkOpSegment* FindSortableTop(const SkTArray<SkOpContour*, true>& contourList,
+ SkOpAngle::IncludeType angleIncludeType, bool* firstContour, int* indexPtr,
+ int* endIndexPtr, SkPoint* topLeft, bool* unsortable, bool* done) {
SkOpSegment* current = findSortableTop(contourList, indexPtr, endIndexPtr, topLeft, unsortable,
done, true);
if (!current) {
@@ -308,8 +311,11 @@ SkOpSegment* FindSortableTop(const SkTArray<SkOpContour*, true>& contourList, bo
if (sumWinding != SK_MinS32) {
return current;
}
- sumWinding = current->computeSum(index, endIndex, binary);
- if (sumWinding != SK_MinS32) {
+ SkASSERT(current->windSum(SkMin32(index, endIndex)) == SK_MinS32);
+ SkSTArray<SkOpAngle::kStackBasedCount, SkOpAngle, true> angles;
+ SkSTArray<SkOpAngle::kStackBasedCount, SkOpAngle*, true> sorted;
+ sumWinding = current->computeSum(index, endIndex, angleIncludeType, &angles, &sorted);
+ if (sumWinding != SK_MinS32 && sumWinding != SK_NaN32) {
return current;
}
int contourWinding;
@@ -333,7 +339,7 @@ SkOpSegment* FindSortableTop(const SkTArray<SkOpContour*, true>& contourList, bo
if (tryAgain) {
continue;
}
- if (!binary) {
+ if (angleIncludeType < SkOpAngle::kBinarySingle) {
break;
}
oppContourWinding = rightAngleWinding(contourList, &current, indexPtr, endIndexPtr, &tHit,
@@ -354,6 +360,15 @@ void CheckEnds(SkTArray<SkOpContour*, true>* contourList) {
}
}
+// A tiny interval may indicate an undiscovered coincidence. Find and fix.
+void CheckTiny(SkTArray<SkOpContour*, true>* contourList) {
+ int contourCount = (*contourList).count();
+ for (int cTest = 0; cTest < contourCount; ++cTest) {
+ SkOpContour* contour = (*contourList)[cTest];
+ contour->checkTiny();
+ }
+}
+
void FixOtherTIndex(SkTArray<SkOpContour*, true>* contourList) {
int contourCount = (*contourList).count();
for (int cTest = 0; cTest < contourCount; ++cTest) {
« no previous file with comments | « src/pathops/SkPathOpsCommon.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698