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:
parent
6aa2965ca8
commit
9284ccd8bc
@ -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,
|
||||
diffPath, renderModeDescriptor);
|
||||
} else if (comparisonBitmap) {
|
||||
return compare_to_reference_image(name, bitmap,
|
||||
*comparisonBitmap, diffPath,
|
||||
renderModeDescriptor);
|
||||
} else {
|
||||
return ERROR_NONE;
|
||||
retval |= compare_to_reference_image(readPath, name, bitmap,
|
||||
diffPath, renderModeDescriptor);
|
||||
}
|
||||
if (writePath) {
|
||||
retval |= write_reference_image(gRec, writePath, renderModeDescriptor,
|
||||
name, bitmap, pdf);
|
||||
}
|
||||
if (comparisonBitmap) {
|
||||
retval |= compare_to_reference_image(name, bitmap,
|
||||
*comparisonBitmap, diffPath,
|
||||
renderModeDescriptor);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user