diff options
author | Mike Reed <reed@google.com> | 2017-07-03 13:36:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-03 19:07:25 +0000 |
commit | a920d367bf9b3724f66173e4aa702ca09f680dea (patch) | |
tree | 6f1501e4c0c1c9568b99428d201adb19e281390e /tests | |
parent | 0401c0d1d3ad9db5d3eecb3096bd569dfe5c2498 (diff) |
remove unneeded code for index8 imagse
Bug: skia:6828
Change-Id: I039d6bc35a1ed93ce747247f32fe4e9d5b09da0c
Reviewed-on: https://skia-review.googlesource.com/21400
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageTest.cpp | 43 | ||||
-rw-r--r-- | tests/ReadPixelsTest.cpp | 3 | ||||
-rw-r--r-- | tests/SwizzlerTest.cpp | 7 |
3 files changed, 0 insertions, 53 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index c57cafa9a3..0b62b00c73 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -296,35 +296,6 @@ DEF_TEST(Image_Serialize_Encoding_Failure, reporter) { } } -#ifdef SK_SUPPORT_LEGACY_INDEX_8 -DEF_TEST(Image_NewRasterCopy, reporter) { - const SkPMColor red = SkPackARGB32(0xFF, 0xFF, 0, 0); - const SkPMColor green = SkPackARGB32(0xFF, 0, 0xFF, 0); - const SkPMColor blue = SkPackARGB32(0xFF, 0, 0, 0xFF); - SkPMColor colors[] = { red, green, blue, 0 }; - sk_sp<SkColorTable> ctable(new SkColorTable(colors, SK_ARRAY_COUNT(colors))); - // The colortable made a copy, so we can trash the original colors - memset(colors, 0xFF, sizeof(colors)); - - const SkImageInfo srcInfo = SkImageInfo::Make(2, 2, kIndex_8_SkColorType, kPremul_SkAlphaType); - const size_t srcRowBytes = 2 * sizeof(uint8_t); - uint8_t indices[] = { 0, 1, 2, 3 }; - auto image = SkImage::MakeRasterCopy(SkPixmap(srcInfo, indices, srcRowBytes, ctable.get())); - // The image made a copy, so we can trash the original indices - memset(indices, 0xFF, sizeof(indices)); - - const SkImageInfo dstInfo = SkImageInfo::MakeN32Premul(2, 2); - const size_t dstRowBytes = 2 * sizeof(SkPMColor); - SkPMColor pixels[4]; - memset(pixels, 0xFF, sizeof(pixels)); // init with values we don't expect - image->readPixels(dstInfo, pixels, dstRowBytes, 0, 0); - REPORTER_ASSERT(reporter, red == pixels[0]); - REPORTER_ASSERT(reporter, green == pixels[1]); - REPORTER_ASSERT(reporter, blue == pixels[2]); - REPORTER_ASSERT(reporter, 0 == pixels[3]); -} -#endif - // Test that a draw that only partially covers the drawing surface isn't // interpreted as covering the entire drawing surface (i.e., exercise one of the // conditions of SkCanvas::wouldOverwriteEntireSurface()). @@ -557,20 +528,6 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_drawAbandonedGpuImage, reporter, c #endif - -#ifdef SK_SUPPORT_LEGACY_INDEX_8 -// https://bug.skia.org/4390 -DEF_TEST(ImageFromIndex8Bitmap, r) { - SkPMColor pmColors[1] = {SkPreMultiplyColor(SK_ColorWHITE)}; - SkBitmap bm; - SkImageInfo info = SkImageInfo::Make(1, 1, kIndex_8_SkColorType, kPremul_SkAlphaType); - bm.allocPixels(info, SkColorTable::Make(pmColors, SK_ARRAY_COUNT(pmColors))); - *bm.getAddr8(0, 0) = 0; - sk_sp<SkImage> img(SkImage::MakeFromBitmap(bm)); - REPORTER_ASSERT(r, img != nullptr); -} -#endif - class EmptyGenerator : public SkImageGenerator { public: EmptyGenerator() : SkImageGenerator(SkImageInfo::MakeN32Premul(0, 0)) {} diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp index ce13fcf9d4..a30576f74c 100644 --- a/tests/ReadPixelsTest.cpp +++ b/tests/ReadPixelsTest.cpp @@ -589,9 +589,6 @@ DEF_TEST(ReadPixels_ValidConversion, reporter) { kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, -#ifdef SK_SUPPORT_LEGACY_INDEX_8 - kIndex_8_SkColorType, -#endif kGray_8_SkColorType, kRGBA_F16_SkColorType, }; diff --git a/tests/SwizzlerTest.cpp b/tests/SwizzlerTest.cpp index 4626a47662..655c97eadd 100644 --- a/tests/SwizzlerTest.cpp +++ b/tests/SwizzlerTest.cpp @@ -11,7 +11,6 @@ #include "SkOpts.h" // These are the values that we will look for to indicate that the fill was successful -static const uint8_t kFillIndex = 0x11; static const uint8_t kFillGray = 0x22; static const uint16_t kFill565 = 0x3344; static const uint32_t kFillColor = 0x55667788; @@ -49,9 +48,6 @@ static void check_fill(skiatest::Reporter* r, for (uint32_t y = startRow; y <= endRow; y++) { for (int32_t x = 0; x < imageInfo.width(); x++) { switch (imageInfo.colorType()) { - case kIndex_8_SkColorType: - REPORTER_ASSERT(r, kFillIndex == indexPtr[x]); - break; case kN32_SkColorType: REPORTER_ASSERT(r, kFillColor == colorPtr[x]); break; @@ -90,7 +86,6 @@ DEF_TEST(SwizzlerFill, r) { // Create image info objects const SkImageInfo colorInfo = SkImageInfo::MakeN32(width, height, kUnknown_SkAlphaType); const SkImageInfo grayInfo = colorInfo.makeColorType(kGray_8_SkColorType); - const SkImageInfo indexInfo = colorInfo.makeColorType(kIndex_8_SkColorType); const SkImageInfo color565Info = colorInfo.makeColorType(kRGB_565_SkColorType); for (uint32_t padding : paddings) { @@ -113,8 +108,6 @@ DEF_TEST(SwizzlerFill, r) { // Test fill with each color type check_fill(r, colorInfo, startRow, endRow, colorRowBytes, offset, kFillColor); - check_fill(r, indexInfo, startRow, endRow, indexRowBytes, offset, - kFillIndex); check_fill(r, grayInfo, startRow, endRow, grayRowBytes, offset, kFillGray); check_fill(r, color565Info, startRow, endRow, color565RowBytes, offset, |