update pathops core and tests
split out skpclip (the test of 1M pictures) into its own project
TBR=reed
Author: caryclark@google.com
Review URL: https://codereview.chromium.org/400033002
diff --git a/src/pathops/SkDLineIntersection.cpp b/src/pathops/SkDLineIntersection.cpp
index 9ae0107..b209474 100644
--- a/src/pathops/SkDLineIntersection.cpp
+++ b/src/pathops/SkDLineIntersection.cpp
@@ -173,21 +173,24 @@
nearCount += t >= 0;
}
if (nearCount > 0) {
- for (int iA = 0; iA < 2; ++iA) {
- if (!aNotB[iA]) {
- continue;
+ // Skip if each segment contributes to one end point.
+ if (nearCount != 2 || aNotB[0] == aNotB[1]) {
+ for (int iA = 0; iA < 2; ++iA) {
+ if (!aNotB[iA]) {
+ continue;
+ }
+ int nearer = aNearB[iA] > 0.5;
+ if (!bNotA[nearer]) {
+ continue;
+ }
+ SkASSERT(a[iA] != b[nearer]);
+ SkASSERT(iA == (bNearA[nearer] > 0.5));
+ fNearlySame[iA] = true;
+ insertNear(iA, nearer, a[iA], b[nearer]);
+ aNearB[iA] = -1;
+ bNearA[nearer] = -1;
+ nearCount -= 2;
}
- int nearer = aNearB[iA] > 0.5;
- if (!bNotA[nearer]) {
- continue;
- }
- SkASSERT(a[iA] != b[nearer]);
- SkASSERT(iA == (bNearA[nearer] > 0.5));
- fNearlySame[iA] = true;
- insertNear(iA, nearer, a[iA], b[nearer]);
- aNearB[iA] = -1;
- bNearA[nearer] = -1;
- nearCount -= 2;
}
if (nearCount > 0) {
for (int iA = 0; iA < 2; ++iA) {