diff options
author | 2016-03-01 12:12:27 -0800 | |
---|---|---|
committer | 2016-03-01 12:12:27 -0800 | |
commit | 7f7ec206de39fde8dc490e9feb0f65322af1b989 (patch) | |
tree | 03bcf8f57a63d0c1039b853679e65cdbad613507 /tests/CodexTest.cpp | |
parent | 4a98cdb7612493a062358cebd1141c9bcaa37ab1 (diff) |
Fix bug in SkGifCodec / Switch SkImageDec tests to use Codec
SkImageDecoder is still used throughout tests, tools, gms etc.
Deleting it from tests is an easy first step.
Bonus is that we add tests of SkCodec.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1733863003
Review URL: https://codereview.chromium.org/1733863003
Diffstat (limited to 'tests/CodexTest.cpp')
-rw-r--r-- | tests/CodexTest.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp index 37e4f305b5..51e41235cb 100644 --- a/tests/CodexTest.cpp +++ b/tests/CodexTest.cpp @@ -12,7 +12,6 @@ #include "SkCodecImageGenerator.h" #include "SkData.h" #include "SkFrontBufferedStream.h" -#include "SkImageDecoder.h" #include "SkMD5.h" #include "SkRandom.h" #include "SkStream.h" @@ -918,10 +917,10 @@ DEF_TEST(Codec_webp_peek, r) { test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr); } -// SkCodec's wbmp decoder was initially more restrictive than SkImageDecoder. -// It required the second byte to be zero. But SkImageDecoder allowed a couple -// of bits to be 1 (so long as they do not overlap with 0x9F). Test that -// SkCodec now supports an image with these bits set. +// SkCodec's wbmp decoder was initially unnecessarily restrictive. +// It required the second byte to be zero. The wbmp specification allows +// a couple of bits to be 1 (so long as they do not overlap with 0x9F). +// Test that SkCodec now supports an image with these bits set. DEF_TEST(Codec_wbmp, r) { const char* path = "mandrill.wbmp"; SkAutoTDelete<SkStream> stream(resource(path)); @@ -935,11 +934,7 @@ DEF_TEST(Codec_wbmp, r) { uint8_t* writeableData = static_cast<uint8_t*>(data->writable_data()); writeableData[1] = static_cast<uint8_t>(~0x9F); - // SkImageDecoder supports this. - SkBitmap bitmap; - REPORTER_ASSERT(r, SkImageDecoder::DecodeMemory(data->data(), data->size(), &bitmap)); - - // So SkCodec should, too. + // SkCodec should support this. SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data)); REPORTER_ASSERT(r, codec); if (!codec) { |