Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2665)

Unified Diff: dm/DMSrcSink.cpp

Issue 1719293002: Make DM failures fatal (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DM.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index bd881e8381739a1c723f8014ed0859fa0a747473..ea21d7a69593c98df6627ee1360cddfa5669f067 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -439,7 +439,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
case kScanline_Mode: {
if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr,
colorCountPtr)) {
- return Error::Nonfatal("Could not start scanline decoder");
+ return "Could not start scanline decoder";
}
void* dst = bitmap.getAddr(0, 0);
@@ -479,12 +479,15 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
// Decode odd stripes
if (SkCodec::kSuccess != codec->startScanlineDecode(decodeInfo, NULL, colorPtr,
- colorCountPtr)
- || SkCodec::kTopDown_SkScanlineOrder != codec->getScanlineOrder()) {
- // 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.
- return Error::Nonfatal("Could not start top-down scanline decoder");
+ colorCountPtr)) {
+ 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.
+ 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) {
@@ -596,20 +599,6 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
case SkCodec::kSuccess:
case SkCodec::kIncompleteInput:
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:
return SkStringPrintf("subset codec failed to decode (%d, %d, %d, %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::kIncompleteInput:
break;
- case SkCodec::kInvalidConversion:
- return Error::Nonfatal("Cannot convert to requested color type.");
default:
return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str());
}
« no previous file with comments | « dm/DM.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698