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

Unified Diff: tests/CodexTest.cpp

Issue 1407603003: Fix SkSwizzler bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added test and rebase Created 5 years, 2 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/SkSwizzler.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 91fb6897b5875fb6d2db3c5fe636105c97a48b16..5ef1f8a86e02cb44f862f15e34484e2e85ccf1f8 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -220,6 +220,26 @@ static void check(skiatest::Reporter* r,
== 0);
REPORTER_ASSERT(r, codec->skipScanlines(1)
== 0);
+
+ // Test partial scanline decodes
+ if (supports_scaled_codec(path) && info.width() >= 3) {
+ SkCodec::Options options;
+ int width = info.width();
+ int height = info.height();
+ SkIRect subset = SkIRect::MakeXYWH(2 * (width / 3), 0, width / 3, height);
+ options.fSubset = ⊂
+
+ const SkCodec::Result partialStartResult = codec->startScanlineDecode(info, &options,
+ nullptr, nullptr);
+ REPORTER_ASSERT(r, partialStartResult == SkCodec::kSuccess);
+
+ for (int y = 0; y < height; y++) {
+ const int lines = codec->getScanlines(bm.getAddr(0, y), 1, 0);
+ if (!isIncomplete) {
+ REPORTER_ASSERT(r, 1 == lines);
+ }
+ }
+ }
} else {
REPORTER_ASSERT(r, startResult == SkCodec::kUnimplemented);
}
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698