diff options
author | msarett <msarett@google.com> | 2016-01-14 13:12:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-14 13:12:26 -0800 |
commit | edd2dcf08224fc6c313610bfc9f9f8257e0e85ef (patch) | |
tree | 2de508045eb035a5298e3e60bfc8f288a4de159a /tests | |
parent | 973ed24fcb58db36588a19c18ae56af8f8adbba3 (diff) |
Create an SkCodecImageGenerator
BUG=skia:
patch from issue 1396323007 at patchset 120001 (http://crrev.com/1396323007#ps120001)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1487683004
Committed: https://skia.googlesource.com/skia/+/e1102ce1d3d0895e840e756e155ec56b5a1a7540
Review URL: https://codereview.chromium.org/1487683004
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CodexTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp index 96d03c1f12..2768d57cfc 100644 --- a/tests/CodexTest.cpp +++ b/tests/CodexTest.cpp @@ -9,6 +9,7 @@ #include "SkAndroidCodec.h" #include "SkBitmap.h" #include "SkCodec.h" +#include "SkCodecImageGenerator.h" #include "SkData.h" #include "SkImageDecoder.h" #include "SkMD5.h" @@ -379,6 +380,18 @@ static void check(skiatest::Reporter* r, &scaledCodecDigest, &codecDigest); } + // Test SkCodecImageGenerator + if (!isIncomplete) { + SkAutoTDelete<SkStream> stream(resource(path)); + SkAutoTUnref<SkData> fullData(SkData::NewFromStream(stream, stream->getLength())); + SkAutoTDelete<SkImageGenerator> gen(SkCodecImageGenerator::NewFromEncodedCodec(fullData)); + SkBitmap bm; + bm.allocPixels(info); + SkAutoLockPixels autoLockPixels(bm); + REPORTER_ASSERT(r, gen->getPixels(info, bm.getPixels(), bm.rowBytes())); + compare_to_good_digest(r, codecDigest, bm); + } + // If we've just tested incomplete decodes, let's run the same test again on full decodes. if (isIncomplete) { check(r, path, size, supportsScanlineDecoding, supportsSubsetDecoding, false); |