Fixed temp dir for snapshots

Change-Id: Ie329a717bb1f8f3b1b69bfbaf0ef852a4193f805
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235396
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
This commit is contained in:
Julia Lavrova 2019-08-16 16:44:40 -04:00 committed by Skia Commit-Bot
parent 8566dda51b
commit aae845f219

View File

@ -83,10 +83,13 @@ public:
}
~TestCanvas() {
SkString path = SkOSPath::Join("/usr/local/google/home/jlavrova/Temp/skia/", name);
SkFILEWStream file(path.c_str());
if (!SkEncodeImage(&file, bits, SkEncodedImageFormat::kPNG, 100)) {
SkDebugf("Cannot write a picture %s\n", name);
SkString tmpDir = skiatest::GetTmpDir();
if (!tmpDir.isEmpty()) {
SkString path = SkOSPath::Join(tmpDir.c_str(), name);
SkFILEWStream file(path.c_str());
if (!SkEncodeImage(&file, bits, SkEncodedImageFormat::kPNG, 100)) {
SkDebugf("Cannot write a picture %s\n", name);
}
}
delete canvas;
}