Make DM failures fatal

We should now only be pushing Srcs for tests that we expect
to succeed.  So any failures should be treated as errors.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1719293002

Review URL: https://codereview.chromium.org/1719293002
This commit is contained in:
msarett 2016-02-23 05:37:25 -08:00 committed by Commit bot
parent d0c4e092d5
commit b65e604f10
2 changed files with 12 additions and 23 deletions

View File

@ -362,6 +362,8 @@ static void push_codec_srcs(Path path) {
case SkEncodedFormat::kWEBP_SkEncodedFormat: case SkEncodedFormat::kWEBP_SkEncodedFormat:
nativeModes.push_back(CodecSrc::kSubset_Mode); nativeModes.push_back(CodecSrc::kSubset_Mode);
break; break;
case SkEncodedFormat::kRAW_SkEncodedFormat:
break;
default: default:
nativeModes.push_back(CodecSrc::kScanline_Mode); nativeModes.push_back(CodecSrc::kScanline_Mode);
nativeModes.push_back(CodecSrc::kStripe_Mode); nativeModes.push_back(CodecSrc::kStripe_Mode);

View File

@ -439,7 +439,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
case kScanline_Mode: { case kScanline_Mode: {
if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr, if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr,
colorCountPtr)) { colorCountPtr)) {
return Error::Nonfatal("Could not start scanline decoder"); return "Could not start scanline decoder";
} }
void* dst = bitmap.getAddr(0, 0); void* dst = bitmap.getAddr(0, 0);
@ -479,12 +479,15 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
// Decode odd stripes // Decode odd stripes
if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr, if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr,
colorCountPtr) colorCountPtr)) {
|| SkCodec::kTopDown_SkScanlineOrder != codec->getScanlineOrder()) { return "Could not start scanline decoder";
// This mode was designed to test the new skip scanlines API in libjpeg-turbo. }
// Jpegs have kTopDown_SkScanlineOrder, and at this time, it is not interesting
// to run this test for image types that do not have this scanline ordering. // This mode was designed to test the new skip scanlines API in libjpeg-turbo.
return Error::Nonfatal("Could not start top-down scanline decoder"); // Jpegs have kTopDown_SkScanlineOrder, and at this time, it is not interesting
// to run this test for image types that do not have this scanline ordering.
if (SkCodec::kTopDown_SkScanlineOrder != codec->getScanlineOrder()) {
return Error::Nonfatal("kStripe test is only interesting for kTopDown codecs.");
} }
for (int i = 0; i < numStripes; i += 2) { for (int i = 0; i < numStripes; i += 2) {
@ -596,20 +599,6 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
case SkCodec::kSuccess: case SkCodec::kSuccess:
case SkCodec::kIncompleteInput: case SkCodec::kIncompleteInput:
break; break;
case SkCodec::kInvalidConversion:
if (0 == (x|y)) {
// First subset is okay to return unimplemented.
return Error::Nonfatal("Incompatible colortype conversion");
}
// If the first subset succeeded, a later one should not fail.
// fall through to failure
case SkCodec::kUnimplemented:
if (0 == (x|y)) {
// First subset is okay to return unimplemented.
return Error::Nonfatal("subset codec not supported");
}
// If the first subset succeeded, why would a later one fail?
// fall through to failure
default: default:
return SkStringPrintf("subset codec failed to decode (%d, %d, %d, %d) " return SkStringPrintf("subset codec failed to decode (%d, %d, %d, %d) "
"from %s with dimensions (%d x %d)\t error %d", "from %s with dimensions (%d x %d)\t error %d",
@ -776,8 +765,6 @@ Error AndroidCodecSrc::draw(SkCanvas* canvas) const {
case SkCodec::kSuccess: case SkCodec::kSuccess:
case SkCodec::kIncompleteInput: case SkCodec::kIncompleteInput:
break; break;
case SkCodec::kInvalidConversion:
return Error::Nonfatal("Cannot convert to requested color type.");
default: default:
return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str()); return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str());
} }