diff options
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r-- | gm/gmmain.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 62ac44ee6f..5eaa50b251 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -48,7 +48,7 @@ static SkString make_filename(const char path[], const SkString& name) { 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 @@ static const struct { { 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 @@ int main (int argc, char * const argv[]) { if (writePath) { SkString path = make_filename(writePath, name); - bool success = SkImageEncoder::EncodeFile(path.c_str(), bitmap, + SkBitmap copy; + bitmap.copyTo(©, 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()); |