aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-21 01:40:31 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-21 01:40:31 +0000
commit25b04349088f5ca956a20cfbdca253520f7d6b50 (patch)
treed8a128713df1f3f75578b337c842cdeeddac0e28
parent8015dd83ae37147bb630d4751030868051ad0cae (diff)
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
-rw-r--r--gm/gmmain.cpp7
-rw-r--r--gm/xfermodes.cpp2
2 files changed, 5 insertions, 4 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(&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());
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp
index e82c057c6c..b52af0245f 100644
--- a/gm/xfermodes.cpp
+++ b/gm/xfermodes.cpp
@@ -67,7 +67,7 @@ protected:
return SkString("xfermodes");
}
- SkISize onISize() { return make_isize(400, 250); }
+ SkISize onISize() { return make_isize(640, 380); }
void drawBG(SkCanvas* canvas) {
canvas->drawColor(SK_ColorWHITE);