| Index: src/pathops/SkPathOpsOp.cpp
 | 
| ===================================================================
 | 
| --- src/pathops/SkPathOpsOp.cpp	(revision 8910)
 | 
| +++ src/pathops/SkPathOpsOp.cpp	(working copy)
 | 
| @@ -149,11 +149,16 @@
 | 
|          do {
 | 
|              if (current->activeOp(index, endIndex, xorMask, xorOpMask, op)) {
 | 
|                  do {
 | 
| +                   if (!unsortable && current->done()) {
 | 
|              #if DEBUG_ACTIVE_SPANS
 | 
| -                    if (!unsortable && current->done()) {
 | 
|                          DebugShowActiveSpans(contourList);
 | 
| +            #endif
 | 
| +                        if (simple->isEmpty()) {
 | 
| +//                            SkDebugf("%s discard empty fragment\n", __FUNCTION__);
 | 
| +                            simple->init();
 | 
| +                            break;
 | 
| +                        }
 | 
|                      }
 | 
| -            #endif
 | 
|                      SkASSERT(unsortable || !current->done());
 | 
|                      int nextStart = index;
 | 
|                      int nextEnd = endIndex;
 | 
| @@ -177,11 +182,11 @@
 | 
|                      current = next;
 | 
|                      index = nextStart;
 | 
|                      endIndex = nextEnd;
 | 
| -                } while (!simple->isClosed() && ((!unsortable)
 | 
| +                } while (!simple->isClosed() && (!unsortable
 | 
|                          || !current->done(SkMin32(index, endIndex))));
 | 
|                  if (current->activeWinding(index, endIndex) && !simple->isClosed()) {
 | 
| -                    SkASSERT(unsortable);
 | 
| -                    int min = SkMin32(index, endIndex);
 | 
| +                    SkASSERT(unsortable || simple->isEmpty());
 | 
| +                    int min = SkMin32(index, endIndex);  
 | 
|                      if (!current->done(min)) {
 | 
|                          current->addCurveTo(index, endIndex, simple, true);
 | 
|                          current->markDoneBinary(min);
 | 
| @@ -227,6 +232,11 @@
 | 
|  };
 | 
|  
 | 
|  bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
 | 
| +#if DEBUG_SHOW_PATH
 | 
| +    ShowPath(one, "path");
 | 
| +    ShowPath(two, "pathB");
 | 
| +    ShowOp(op, "path", "pathB");
 | 
| +#endif
 | 
|      op = gOpInverse[op][one.isInverseFillType()][two.isInverseFillType()];
 | 
|      SkPath::FillType fillType = gOutInverse[op][one.isInverseFillType()][two.isInverseFillType()]
 | 
|              ? SkPath::kInverseEvenOdd_FillType : SkPath::kEvenOdd_FillType;
 | 
| @@ -288,7 +298,7 @@
 | 
|  #endif
 | 
|      FixOtherTIndex(&contourList);
 | 
|      SortSegments(&contourList);
 | 
| -#if DEBUG_ACTIVE_SPANS
 | 
| +#if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY
 | 
|      DebugShowActiveSpans(contourList);
 | 
|  #endif
 | 
|      // construct closed contours
 | 
| 
 |