use contour with global ymax to determine direction



git-svn-id: http://skia.googlecode.com/svn/trunk@3110 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 9298d53..bab7f87 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -58,6 +58,18 @@
         REPORTER_ASSERT(reporter, valid);
         REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCCW_Direction));
     }
+
+    // Test two donuts, each wound a different direction. Only the outer contour
+    // determines the cheap direction
+    path.reset();
+    path.addCircle(0, 0, SkIntToScalar(2), SkPath::kCW_Direction);
+    path.addCircle(0, 0, SkIntToScalar(1), SkPath::kCCW_Direction);
+    REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCW_Direction));
+    
+    path.reset();
+    path.addCircle(0, 0, SkIntToScalar(1), SkPath::kCW_Direction);
+    path.addCircle(0, 0, SkIntToScalar(2), SkPath::kCCW_Direction);
+    REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCCW_Direction));
 }
 
 static void add_rect(SkPath* path, const SkRect& r) {