Fix the problem of rendering closePath not properly after a moveTo call in
canvas 2D interface. If there is a polyline, followed by a moveTo and a
closePath, both the moveTo and the closePath should be ignored for the purposes
of drawing, and the polyline should not be closed (unless force closed is true
(for filling, for instance).

Tested for path with both valid and degenerate content, when asked to
consume degenerates and not, force closed and not.

This patch also includes a uni test refactoring to reduce the amount of code
to test path iteration and zero length paths.

BUG=6297049

TEST=tests/PathTest.cpp, testIter method.
Review URL: https://codereview.appspot.com/6300086

git-svn-id: http://skia.googlecode.com/svn/trunk@4247 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 7688f10..e2382df 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1485,8 +1485,9 @@
                 break;
 
             case kClose_Verb:
-                // A close when we are in a segment is always valid
-                if (fSegmentState == kAfterPrimitive_SegmentState) {
+                // A close when we are in a segment is always valid except when it
+                // follows a move which follows a segment.
+                if (fSegmentState == kAfterPrimitive_SegmentState && !lastMoveVerb) {
                     return;
                 }
                 // A close at any other time must be ignored