aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecAnimTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CodecAnimTest.cpp')
-rw-r--r--tests/CodecAnimTest.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/CodecAnimTest.cpp b/tests/CodecAnimTest.cpp
index a3e16c6aa5..4e069c17fb 100644
--- a/tests/CodecAnimTest.cpp
+++ b/tests/CodecAnimTest.cpp
@@ -422,9 +422,27 @@ DEF_TEST(AndroidCodec_animated, r) {
options.fPriorFrame = i - 1;
info = info.makeAlphaType(frameInfo.fAlphaType);
- const auto result = codec->codec()->getPixels(info, bm.getPixels(), bm.rowBytes(),
- &options);
+ auto result = codec->codec()->getPixels(info, bm.getPixels(), bm.rowBytes(),
+ &options);
REPORTER_ASSERT(r, result == SkCodec::kSuccess);
+
+ // Now compare to not using prior frame.
+ SkBitmap bm2;
+ bm2.allocPixels(info);
+
+ options.fPriorFrame = SkCodec::kNone;
+ result = codec->codec()->getPixels(info, bm2.getPixels(), bm2.rowBytes(),
+ &options);
+ REPORTER_ASSERT(r, result == SkCodec::kSuccess);
+
+ for (int y = 0; y < info.height(); ++y) {
+ if (memcmp(bm.getAddr32(0, y), bm2.getAddr32(0, y), info.minRowBytes())) {
+ ERRORF(r, "pixel mismatch for sample size %i, frame %i resulting in "
+ "dimensions %i x %i line %i\n",
+ sampleSize, i, info.width(), info.height(), y);
+ break;
+ }
+ }
}
}
}