Make gm tool able to read and write image files in the same run

BUG=http://code.google.com/p/skia/issues/detail?id=571
Review URL: https://codereview.appspot.com/6052050

git-svn-id: http://skia.googlecode.com/svn/trunk@3717 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2012-04-18 13:36:54 +00:00
parent 6aa2965ca8
commit 9284ccd8bc

View File

@ -462,23 +462,25 @@ static ErrorBitfield handle_test_results(GM* gm,
SkDynamicMemoryWStream* pdf,
const SkBitmap* comparisonBitmap) {
SkString name = make_name(gm->shortName(), gRec.fName);
ErrorBitfield retval = ERROR_NONE;
if (writePath) {
return write_reference_image(gRec, writePath, renderModeDescriptor,
name, bitmap, pdf);
} else if (readPath && (
if (readPath && (
gRec.fBackend == kRaster_Backend ||
gRec.fBackend == kGPU_Backend ||
(gRec.fBackend == kPDF_Backend && CAN_IMAGE_PDF))) {
return compare_to_reference_image(readPath, name, bitmap,
retval |= compare_to_reference_image(readPath, name, bitmap,
diffPath, renderModeDescriptor);
} else if (comparisonBitmap) {
return compare_to_reference_image(name, bitmap,
}
if (writePath) {
retval |= write_reference_image(gRec, writePath, renderModeDescriptor,
name, bitmap, pdf);
}
if (comparisonBitmap) {
retval |= compare_to_reference_image(name, bitmap,
*comparisonBitmap, diffPath,
renderModeDescriptor);
} else {
return ERROR_NONE;
}
return retval;
}
static SkPicture* generate_new_picture(GM* gm) {
@ -816,7 +818,8 @@ int main(int argc, char * const argv[]) {
if (readPath) {
fprintf(stderr, "reading from %s\n", readPath);
} else if (writePath) {
}
if (writePath) {
fprintf(stderr, "writing to %s\n", writePath);
}