diff options
author | msarett <msarett@google.com> | 2015-07-01 06:50:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-01 06:50:35 -0700 |
commit | c0e80c139e15496a8a96eec7848689b6f0e7bcc1 (patch) | |
tree | 6c3fbc2df1ec557f196c4a0dde6a28989f95a43e /tests | |
parent | f06c389f0fe07ce06acd8568d508d6413b8d3728 (diff) |
In the case of subset decodes, we will often not decode to
the bottom of the image. In our code before this patch,
this would result in cleanup code in onFinish() never being
called.
We can allow subclasses to take ownership of the
SkScanlineDecoder in order to make sure that it is
finished/deleted before deleting the decode manager.
BUG=skia:
Review URL: https://codereview.chromium.org/1212593003
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CodexTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp index 5c969908b9..0edd3cf907 100644 --- a/tests/CodexTest.cpp +++ b/tests/CodexTest.cpp @@ -72,6 +72,10 @@ static void check(skiatest::Reporter* r, if (supportsScanlineDecoding) { bm.eraseColor(SK_ColorYELLOW); REPORTER_ASSERT(r, scanlineDecoder); + + // 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); for (int y = 0; y < info.height(); y++) { result = scanlineDecoder->getScanlines(bm.getAddr(0, y), 1, 0); REPORTER_ASSERT(r, result == SkImageGenerator::kSuccess); |