fuzzer fixes

Fix path bugs exposed by the path fuzzer.

Changes to existing gm and samplecode files defer their calls to construct
SkPath objects until the first draw instead of at test initialization.

Add an experimental call to SkPath to validate the internal SkPathRef.

Fix SkPath::addPoly to set the last moveto after adding a close verb.

Fix stroke to handle failures when computing the unit normal.

Add a unit test for the unit normal failure.

R=reed@google.com

Review URL: https://codereview.chromium.org/953383002
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index a5f91c2..f1574fb 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.cpp
@@ -96,6 +96,10 @@
 
 public:
     PathEffectView() : fPhase(0) {
+        }
+
+protected:
+    void onOnceBeforeDraw() SK_OVERRIDE {
         SkRandom    rand;
         int         steps = 20;
         SkScalar    dist = SkIntToScalar(400);
@@ -126,7 +130,6 @@
         this->setBGColor(0xFFDDDDDD);
     }
 
-protected:
     bool onQuery(SkEvent* evt) SK_OVERRIDE {
         if (SampleCode::TitleQ(*evt)) {
             SampleCode::TitleR(evt, "PathEffects");