gm -w 'directory' now works for recording the master images



git-svn-id: http://skia.googlecode.com/svn/trunk@229 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 62ac44e..5eaa50b 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -48,7 +48,7 @@
     if (filename.size() && filename[filename.size() - 1] != '/') {
         filename.append("/");
     }
-    filename.append(name);
+    filename.appendf("%s.png", name.c_str());
     return filename;
 }
 
@@ -64,7 +64,6 @@
 	{ SkBitmap::kARGB_8888_Config,	false,	"8888" },
 	{ SkBitmap::kARGB_4444_Config,	false,	"4444" },
 	{ SkBitmap::kRGB_565_Config,	false,	"565" },
-	{ SkBitmap::kA8_Config,			false,	"A8" },
 };
 
 int main (int argc, char * const argv[]) {
@@ -109,7 +108,9 @@
 
             if (writePath) {
                 SkString path = make_filename(writePath, name);
-                bool success = SkImageEncoder::EncodeFile(path.c_str(), bitmap,
+                SkBitmap copy;
+                bitmap.copyTo(&copy, SkBitmap::kARGB_8888_Config);
+                bool success = SkImageEncoder::EncodeFile(path.c_str(), copy,
                                                 SkImageEncoder::kPNG_Type, 100);
                 if (!success) {
                     fprintf(stderr, "FAILED to write %s\n", path.c_str());