path ops -- rewrite angle sort

This is a major change resulting from a minor
tweak. In the old code, the intersection point
of two curves was shared between them, but the
intersection points and end points of sorted edges was
computed directly from the intersection T value.

In this CL, both intersection points and sorted points
are the same, and intermediate control points are computed
to preserve their slope.

The sort itself has been completely rewritten to be more
robust and remove 'magic' checks, conditions that empirically
worked but couldn't be rationalized.

This CL was triggered by errors generated computing the clips
of SKP files. At this point, all 73M standard tests work and
at least the first troublesome SKPs work.

Review URL: https://codereview.chromium.org/15338003

git-svn-id: http://skia.googlecode.com/svn/trunk@9432 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PathOpsSkpClipTest.cpp b/tests/PathOpsSkpClipTest.cpp
index d14cde5..98e5553 100644
--- a/tests/PathOpsSkpClipTest.cpp
+++ b/tests/PathOpsSkpClipTest.cpp
@@ -1,6 +1,7 @@
 #include "SkBitmap.h"
 #include "SkDevice.h"
 #include "SkCanvas.h"
+#include "SkImageDecoder.h"
 #include "SkImageEncoder.h"
 #include "SkStream.h"
 #include "SkOSFile.h"
@@ -18,14 +19,14 @@
 }
 
 static void PathOpsSkpClipTest(skiatest::Reporter* reporter) {
-const char pictDir[] = "C:\\Users\\caryclark\\skp";
-    const char outSkpClipDir[] = "C:\\Users\\caryclark\\skpClip";
-    const char outOldClipDir[] = "C:\\Users\\caryclark\\oldClip";
+    const char pictDir[] = "D:\\skp";
+    const char outSkpClipDir[] = "D:\\skpClip";
+    const char outOldClipDir[] = "D:\\oldClip";
     SkOSFile::Iter iter(pictDir, "skp");
     SkString filename;
     while (iter.next(&filename)) {
-#if 0
-        if (strcmp(filename.c_str(), "tabl_androidpolice.skp")) {
+#if 01
+        if (strcmp(filename.c_str(), "desk_15min-lt.skp")) {
             continue;
         }
 #endif
@@ -35,7 +36,11 @@
         if (!stream.isValid()) {
             continue;
         }
-        SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream));
+        bool success;
+        SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream, &success, &SkImageDecoder::DecodeMemory));
+        if (!success) {
+            continue;
+        }
         int width = pic->width();
         int height = pic->height();
         SkBitmap bitmap;