Test scaling for small images
We don't want to test small images on Gold because they are
not interested to look at. Instead, I wrote a unit test to
verify that scaling small images does not cause crashes.
BUG=skia:
Review URL: https://codereview.chromium.org/1287863004
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 9826f97..f766b49 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -120,6 +120,12 @@
if (size == decodeInfo.dimensions() && 1.0f != fScale) {
return Error::Nonfatal("Test without scaling is uninteresting.");
}
+
+ // Visually inspecting very small output images is not necessary. We will
+ // cover these cases in unit testing.
+ if ((size.width() <= 10 || size.height() <= 10) && 1.0f != fScale) {
+ return Error::Nonfatal("Scaling very small images is uninteresting.");
+ }
decodeInfo = decodeInfo.makeWH(size.width(), size.height());
// Construct a color table for the decode if necessary