Rename the existing flatten(void*) methods.

This change avoids naminc confusion with the SkFlattenable flatten methods and
also changes SkPath to use the void* model instead of taking a SkReader32.
Review URL: https://codereview.appspot.com/6299062

git-svn-id: http://skia.googlecode.com/svn/trunk@4215 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 21f78bf..ff12e8e 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -700,7 +700,7 @@
     p.cubicTo(pts[4], pts[5], pts[6]);
 
     SkWriter32 writer(100);
-    p.flatten(writer);
+    writer.writePath(p);
     size_t size = writer.size();
     SkAutoMalloc storage(size);
     writer.flatten(storage.get());
@@ -708,8 +708,25 @@
 
     SkPath p1;
     REPORTER_ASSERT(reporter, p1 != p);
-    p1.unflatten(reader);
+    reader.readPath(&p1);
     REPORTER_ASSERT(reporter, p1 == p);
+
+    // create a buffer that should be much larger than the path so we don't
+    // kill our stack if writer goes too far.
+    char buffer[1024];
+    uint32_t size1 = p.writeToMemory(NULL);
+    uint32_t size2 = p.writeToMemory(buffer);
+    REPORTER_ASSERT(reporter, size1 == size2);
+
+    SkPath p2;
+    uint32_t size3 = p2.readFromMemory(buffer);
+    REPORTER_ASSERT(reporter, size1 == size3);
+    REPORTER_ASSERT(reporter, p == p2);
+
+    char buffer2[1024];
+    size3 = p2.writeToMemory(buffer2);
+    REPORTER_ASSERT(reporter, size1 == size3);
+    REPORTER_ASSERT(reporter, memcmp(buffer, buffer2, size1) == 0);
 }
 
 static void test_transform(skiatest::Reporter* reporter) {