add new cubic test for overflow



git-svn-id: http://skia.googlecode.com/svn/trunk@379 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index e63c513..1eb4222 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -11,6 +11,7 @@
 #include "SkXfermode.h"
 #include "SkColorPriv.h"
 #include "SkColorFilter.h"
+#include "SkParsePath.h"
 #include "SkTime.h"
 #include "SkTypeface.h"
 
@@ -37,6 +38,36 @@
 #endif
 }
 
+static void test_cubic2() {
+    const char* str = "M2242 -590088L-377758 9.94099e+07L-377758 9.94099e+07L2242 -590088Z";
+    SkPath path;
+    SkParsePath::FromSVGString(str, &path);
+    
+    {
+        float x = strtof("9.94099e+07", NULL);
+        int ix = (int)x;
+        int fx = (int)(x * 65536);
+        int ffx = SkScalarToFixed(x);
+        printf("%g %x %x %x\n", x, ix, fx, ffx);
+        
+        SkRect r = path.getBounds();
+        SkIRect ir;
+        r.round(&ir);
+        printf("[%g %g %g %g] [%x %x %x %x]\n",
+               r.fLeft, r.fTop, r.fRight, r.fBottom,
+               ir.fLeft, ir.fTop, ir.fRight, ir.fBottom);
+    }
+    
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 300, 200);
+    bitmap.allocPixels();
+
+    SkCanvas canvas(bitmap);
+    SkPaint paint;
+    paint.setAntiAlias(true);
+    canvas.drawPath(path, paint);
+}
+
 class PathView : public SkView {
 public:
     int fDStroke, fStroke, fMinStroke, fMaxStroke;
@@ -45,6 +76,7 @@
     
 	PathView() {
         test_cubic();
+        test_cubic2();
 
         fShowHairline = false;