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

Unified Diff: tests/CodexTest.cpp

Issue 1220733013: SkCodec no longer inherits from SkImageGenerator. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Manually handle the lifetime of fScanlineDecoder. Created 5 years, 5 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/codec/SkWebpCodec.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 0edd3cf907d62159e0ba5ff00de4288453ab59dd..32968fdb7a91b06ce62066e4dec51e9d6a2a86bf 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -9,6 +9,7 @@
#include "SkBitmap.h"
#include "SkCodec.h"
#include "SkMD5.h"
+#include "SkScanlineDecoder.h"
#include "Test.h"
static SkStreamAsset* resource(const char path[]) {
@@ -51,9 +52,9 @@ static void check(skiatest::Reporter* r,
SkBitmap bm;
bm.allocPixels(info);
SkAutoLockPixels autoLockPixels(bm);
- SkImageGenerator::Result result =
+ SkCodec::Result result =
codec->getPixels(info, bm.getPixels(), bm.rowBytes(), NULL, NULL, NULL);
- REPORTER_ASSERT(r, result == SkImageGenerator::kSuccess);
+ REPORTER_ASSERT(r, result == SkCodec::kSuccess);
SkMD5::Digest digest1, digest2;
md5(bm, &digest1);
@@ -63,7 +64,7 @@ static void check(skiatest::Reporter* r,
result =
codec->getPixels(info, bm.getPixels(), bm.rowBytes(), NULL, NULL, NULL);
- REPORTER_ASSERT(r, result == SkImageGenerator::kSuccess);
+ REPORTER_ASSERT(r, result == SkCodec::kSuccess);
// verify that re-decoding gives the same result.
md5(bm, &digest2);
REPORTER_ASSERT(r, digest1 == digest2);
@@ -75,10 +76,10 @@ static void check(skiatest::Reporter* r,
// Regular decodes should be disabled after creating a scanline decoder
result = codec->getPixels(info, bm.getPixels(), bm.rowBytes(), NULL, NULL, NULL);
- REPORTER_ASSERT(r, SkImageGenerator::kInvalidParameters == result);
+ REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result);
for (int y = 0; y < info.height(); y++) {
result = scanlineDecoder->getScanlines(bm.getAddr(0, y), 1, 0);
- REPORTER_ASSERT(r, result == SkImageGenerator::kSuccess);
+ REPORTER_ASSERT(r, result == SkCodec::kSuccess);
}
// verify that scanline decoding gives the same result.
SkMD5::Digest digest3;
@@ -189,9 +190,9 @@ static void test_dimensions(skiatest::Reporter* r, const char path[]) {
size_t totalBytes = scaledInfo.getSafeSize(rowBytes);
SkAutoTMalloc<SkPMColor> pixels(totalBytes);
- SkImageGenerator::Result result =
+ SkCodec::Result result =
codec->getPixels(scaledInfo, pixels.get(), rowBytes, NULL, NULL, NULL);
- REPORTER_ASSERT(r, SkImageGenerator::kSuccess == result);
+ REPORTER_ASSERT(r, SkCodec::kSuccess == result);
}
}
« no previous file with comments | « src/codec/SkWebpCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698