| 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);
|
| }
|
|
|