aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-09-08 10:54:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-08 10:54:34 -0700
commit85c922acec37726ac64e9be9a79de697c677f35d (patch)
treece407f846cdad8e4cf71c6d0479a1588b45d5cf6 /tests
parent7a9900d6d34e437bb24beb5524a1f6488ae138c9 (diff)
Revert of Checking for valid colorType, alphaType, colorSpace in SkCodec (patchset #2 id:100001 of https://codereview.chromium.org/2319293003/ )
Reason for revert: Broken perf bots Original issue's description: > Checking for valid colorType, alphaType, colorSpace in SkCodec > > * Refactor to share code between SkPngCodec and SkWebpCodec > * Didn't end up sharing with SkJpegCodec but did refactor > that code a bit > * Disallow conversions to F16 with non-linear color spaces > * Fail to decode if we fail to create a SkColorSpaceXform > (should be an assert soon). We used to fallback on a > legacy decode if we failed to create the transform. > * A bunch of name changes > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2319293003 > > Committed: https://skia.googlesource.com/skia/+/7a9900d6d34e437bb24beb5524a1f6488ae138c9 TBR=scroggo@google.com,brianosman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2328663002
Diffstat (limited to 'tests')
-rw-r--r--tests/CodecTest.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index b01750d410..9c60be4b6b 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -1120,33 +1120,3 @@ DEF_TEST(Codec_PngRoundTrip, r) {
REPORTER_ASSERT(r, SkCodec::kSuccess == result);
check_round_trip(r, bm2);
}
-
-static void test_conversion_possible(skiatest::Reporter* r, const char* path,
- bool testScanlineDecoder) {
- SkAutoTDelete<SkStream> stream(resource(path));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
- SkImageInfo infoF16 = codec->getInfo().makeColorType(kRGBA_F16_SkColorType);
-
- SkBitmap bm;
- bm.allocPixels(infoF16);
- SkCodec::Result result = codec->getPixels(infoF16, bm.getPixels(), bm.rowBytes());
- REPORTER_ASSERT(r, SkCodec::kInvalidConversion == result);
- if (testScanlineDecoder) {
- result = codec->startScanlineDecode(infoF16);
- REPORTER_ASSERT(r, SkCodec::kInvalidConversion == result);
- }
-
- infoF16 = infoF16.makeColorSpace(infoF16.colorSpace()->makeLinearGamma());
- result = codec->getPixels(infoF16, bm.getPixels(), bm.rowBytes());
- REPORTER_ASSERT(r, SkCodec::kSuccess == result);
- if (testScanlineDecoder) {
- result = codec->startScanlineDecode(infoF16);
- REPORTER_ASSERT(r, SkCodec::kSuccess == result);
- }
-}
-
-DEF_TEST(Codec_F16ConversionPossible, r) {
- test_conversion_possible(r, "color_wheel.webp", false);
- test_conversion_possible(r, "mandrill_512_q075.jpg", true);
- test_conversion_possible(r, "yellow_rose.png", true);
-}