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

Unified Diff: tests/CodexTest.cpp

Issue 1487683004: Create an SkCodecImageGenerator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test in CodexTest, do not replace SkIDGenerator Created 4 years, 11 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 | « src/core/SkCodecImageGenerator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CodexTest.cpp
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp
index 96d03c1f126aa15214db0378c9f2290bb0a72fa1..2768d57cfc392de03d58dbe07212a90e5f07a077 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()));
scroggo 2016/01/14 19:06:18 Are these ever index8? If so, it seems like we've
msarett 2016/01/14 19:13:12 Up at the top, we force info to kN32. Partly I th
scroggo 2016/01/14 19:18:32 Ah, great. Nvm then.
+ 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);
« no previous file with comments | « src/core/SkCodecImageGenerator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698