Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: tests/TextureCompressionTest.cpp

Issue 425223006: Revert of Add initial pipeline for decompressors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkTextureCompressor_R11EAC.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TextureCompressionTest.cpp
diff --git a/tests/TextureCompressionTest.cpp b/tests/TextureCompressionTest.cpp
index 7313487ffc3615a60b3ddaa9b9a74e01cd8dc555..503605b003e4303cb42b168fe9ae0175f16f208e 100644
--- a/tests/TextureCompressionTest.cpp
+++ b/tests/TextureCompressionTest.cpp
@@ -75,86 +75,6 @@
}
/**
- * Make sure that if you compress a texture with alternating black/white pixels, and
- * then decompress it, you get what you started with.
- */
-DEF_TEST(CompressCheckerboard, reporter) {
- SkBitmap bitmap;
- static const int kWidth = 12;
- static const int kHeight = 12;
- SkImageInfo info = SkImageInfo::MakeA8(kWidth, kHeight);
-
- // ASTC is at most 12x12, and any dimension divisible by 12 is also divisible
- // by 4, which is the dimensions of R11_EAC and LATC. In the future, we might
- // support additional variants of ASTC, such as 5x6 and 8x8, in which case this would
- // need to be updated.
- REPORTER_ASSERT(reporter, kWidth % 12 == 0);
- REPORTER_ASSERT(reporter, kHeight % 12 == 0);
-
- bool setInfoSuccess = bitmap.setInfo(info);
- REPORTER_ASSERT(reporter, setInfoSuccess);
-
- bool allocPixelsSuccess = bitmap.allocPixels(info);
- REPORTER_ASSERT(reporter, allocPixelsSuccess);
-
- bitmap.lockPixels();
- uint8_t* pixels = reinterpret_cast<uint8_t*>(bitmap.getPixels());
- REPORTER_ASSERT(reporter, NULL != pixels);
-
- for (int y = 0; y < kHeight; ++y) {
- for (int x = 0; x < kWidth; ++x) {
- if ((x ^ y) & 1) {
- pixels[x] = 0xFF;
- } else {
- pixels[x] = 0;
- }
- }
- pixels += bitmap.rowBytes();
- }
- bitmap.unlockPixels();
-
- SkAutoMalloc decompMemory(kWidth*kHeight);
- uint8_t* decompBuffer = reinterpret_cast<uint8_t*>(decompMemory.get());
- REPORTER_ASSERT(reporter, NULL != decompBuffer);
- if (NULL == decompBuffer) {
- return;
- }
-
- for (int i = 0; i < SkTextureCompressor::kFormatCnt; ++i) {
- const SkTextureCompressor::Format fmt = static_cast<SkTextureCompressor::Format>(i);
-
- // ASTC is for RGBA data, and the decompressed buffer
- // won't match the size and contents of the original.
- // TODO: Create separate tests for RGB and RGBA data once
- // ASTC decompression is implemented.
- if (SkTextureCompressor::kASTC_12x12_Format == fmt) {
- continue;
- }
-
- SkAutoDataUnref data(SkTextureCompressor::CompressBitmapToFormat(bitmap, fmt));
- REPORTER_ASSERT(reporter, NULL != data);
-
- bool decompResult =
- SkTextureCompressor::DecompressBufferFromFormat(
- decompBuffer, kWidth,
- data->bytes(),
- kWidth, kHeight, fmt);
- REPORTER_ASSERT(reporter, decompResult);
-
- bitmap.lockPixels();
- pixels = reinterpret_cast<uint8_t*>(bitmap.getPixels());
- REPORTER_ASSERT(reporter, NULL != pixels);
-
- for (int y = 0; y < kHeight; ++y) {
- for (int x = 0; x < kWidth; ++x) {
- bool ok = pixels[y*bitmap.rowBytes() + x] == decompBuffer[y*kWidth + x];
- REPORTER_ASSERT(reporter, ok);
- }
- }
- }
-}
-
-/**
* Make sure that if we pass in a solid color bitmap that we get the appropriate results
*/
DEF_TEST(CompressLATC, reporter) {
« no previous file with comments | « src/utils/SkTextureCompressor_R11EAC.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698